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