From 329ad99edc87bf702ad54124877cf5177ac92012 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 19 Mar 2012 09:27:39 -0500 Subject: [PATCH] Add Langauge#escaped_name --- lib/linguist/language.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 6fba0dd7..4b389a36 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -1,5 +1,6 @@ -require 'yaml' require 'pygments' +require 'uri' +require 'yaml' module Linguist # Language names that are recognizable by GitHub. Defined languages @@ -322,6 +323,19 @@ module Linguist # Returns the extensions Array attr_reader :filenames + # Public: Get URL escaped name. + # + # Examples + # + # "C%23" + # "C%2B%2B" + # "Common%20Lisp" + # + # Returns the escaped String. + def escaped_name + URI.escape(name) + end + # Internal: Get default alias name # # Returns the alias name String