Skip to content

Commit

Permalink
Merge pull request github-linguist#2447 from Ryman/rustup
Browse files Browse the repository at this point in the history
Split on comma in language name if no match is found
  • Loading branch information
arfon committed Aug 7, 2015
2 parents 7238f50 + bc8d65e commit deab066
Show file tree
Hide file tree
Showing 4 changed files with 2,351 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/linguist/language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def self.all
#
# Returns the Language or nil if none was found.
def self.find_by_name(name)
name && @name_index[name.downcase]
name && (@name_index[name.downcase] || @name_index[name.split(',').first.downcase])
end

# Public: Look up Language by one of its aliases.
Expand All @@ -164,7 +164,7 @@ def self.find_by_name(name)
#
# Returns the Language or nil if none was found.
def self.find_by_alias(name)
name && @alias_index[name.downcase]
name && (@alias_index[name.downcase] || @alias_index[name.split(',').first.downcase])
end

# Public: Look up Languages by filename.
Expand Down Expand Up @@ -240,7 +240,7 @@ def self.find_by_interpreter(interpreter)
#
# Returns the Language or nil if none was found.
def self.[](name)
name && @index[name.downcase]
name && (@index[name.downcase] || @index[name.split(',').first.downcase])
end

# Public: A List of popular languages
Expand Down
Loading

0 comments on commit deab066

Please sign in to comment.