Prefer aliases over shebang config

This commit is contained in:
Joshua Peek
2011-06-01 22:42:27 -05:00
parent beee499fdc
commit 08299a0048
3 changed files with 10 additions and 35 deletions

View File

@@ -353,12 +353,6 @@ module Linguist
end
end
shebangs = YAML.load_file(File.expand_path("../shebangs.yml", __FILE__))
Shebangs = shebangs.inject({}) { |h, (name, scripts)|
scripts.each { |script| h[script] = Language[name] }
h
}
# Internal: Get Language for shebang script
#
# Matches script name with shebang script name mappings in "shebangs.yml"
@@ -366,12 +360,8 @@ module Linguist
# Returns the Language or nil
def shebang_language
if script = shebang_script
if lang = Shebangs[script]
lang
else
lang = Language[script]
lang != Language['Text'] ? lang : nil
end
lang = Language[script]
lang != Language['Text'] ? lang : nil
end
end

View File

@@ -271,6 +271,7 @@ Groovy:
JavaScript:
:aliases:
- js
- node
:ext:
- .js
- .sjs
@@ -334,6 +335,8 @@ Myghty:
- .myt
Nu:
:lexer: scheme
:aliases:
- nush
:ext:
- .nu
- Nukefile
@@ -437,6 +440,11 @@ Redcode:
:ext:
- .cw
Ruby:
:aliases:
- jruby
- macruby
- rake
- rbx
:ext:
- .rb
- .ru

View File

@@ -1,23 +0,0 @@
# Maps shebang script names to Language names
#
# Language names are implicitly mapped to their downcased versions,
# so this would be redundant:
#
# Ruby:
# - ruby
Java:
- groovy
# JavaScript interpreters
JavaScript:
- node
# Ruby interpreters and runners
Ruby:
- macruby
- rake
# Nu shell
Nu:
- nush