mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9385e70d2d | ||
|
|
9469e188c8 | ||
|
|
6e57ca6fbc | ||
|
|
d5e3ebaef3 | ||
|
|
a9eac8a832 | ||
|
|
1c7f5368cf | ||
|
|
960ff73c7f | ||
|
|
e1ce30c3ce | ||
|
|
89b442c751 | ||
|
|
6b41059cdf | ||
|
|
62cb42eee5 | ||
|
|
6bbb56db00 | ||
|
|
160598b9ef | ||
|
|
729a174eb6 | ||
|
|
87df17309c | ||
|
|
b5cacbba9f |
@@ -164,7 +164,7 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns the Language or nil if none was found.
|
# Returns the Language or nil if none was found.
|
||||||
def self.find_by_name(name)
|
def self.find_by_name(name)
|
||||||
@name_index[name.downcase]
|
name && @name_index[name.downcase]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Look up Language by one of its aliases.
|
# Public: Look up Language by one of its aliases.
|
||||||
@@ -178,7 +178,7 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns the Lexer or nil if none was found.
|
# Returns the Lexer or nil if none was found.
|
||||||
def self.find_by_alias(name)
|
def self.find_by_alias(name)
|
||||||
@alias_index[name.downcase]
|
name && @alias_index[name.downcase]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Look up Languages by filename.
|
# Public: Look up Languages by filename.
|
||||||
@@ -243,7 +243,7 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns the Language or nil if none was found.
|
# Returns the Language or nil if none was found.
|
||||||
def self.[](name)
|
def self.[](name)
|
||||||
@index[name.downcase]
|
name && @index[name.downcase]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: A List of popular languages
|
# Public: A List of popular languages
|
||||||
|
|||||||
@@ -869,6 +869,7 @@ GAS:
|
|||||||
extensions:
|
extensions:
|
||||||
- .s
|
- .s
|
||||||
- .S
|
- .S
|
||||||
|
tm_scope: source.asm.x86
|
||||||
|
|
||||||
GDScript:
|
GDScript:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1419,7 +1420,7 @@ Less:
|
|||||||
lexer: CSS
|
lexer: CSS
|
||||||
extensions:
|
extensions:
|
||||||
- .less
|
- .less
|
||||||
tm_scope: source.css
|
tm_scope: source.css.less
|
||||||
|
|
||||||
LilyPond:
|
LilyPond:
|
||||||
lexer: Text only
|
lexer: Text only
|
||||||
@@ -2096,6 +2097,7 @@ Python:
|
|||||||
- wscript
|
- wscript
|
||||||
- SConstruct
|
- SConstruct
|
||||||
- SConscript
|
- SConscript
|
||||||
|
- BUILD
|
||||||
interpreters:
|
interpreters:
|
||||||
- python
|
- python
|
||||||
|
|
||||||
@@ -2813,7 +2815,11 @@ XML:
|
|||||||
- .classpath
|
- .classpath
|
||||||
- .project
|
- .project
|
||||||
- build.xml.dist
|
- build.xml.dist
|
||||||
|
- packages.config
|
||||||
- phpunit.xml.dist
|
- phpunit.xml.dist
|
||||||
|
- Web.config
|
||||||
|
- Web.Debug.config
|
||||||
|
- Web.Release.config
|
||||||
|
|
||||||
XProc:
|
XProc:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2882,7 +2888,7 @@ Zephir:
|
|||||||
color: "#118f9e"
|
color: "#118f9e"
|
||||||
extensions:
|
extensions:
|
||||||
- .zep
|
- .zep
|
||||||
tm_scope: text.html.php
|
tm_scope: source.php.zephir
|
||||||
|
|
||||||
Zimpl:
|
Zimpl:
|
||||||
type: programming
|
type: programming
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module Linguist
|
module Linguist
|
||||||
VERSION = "3.5.0"
|
VERSION = "3.5.2"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ class TestLanguage < Test::Unit::TestCase
|
|||||||
assert_equal Language['VimL'], Language.find_by_alias('viml')
|
assert_equal Language['VimL'], Language.find_by_alias('viml')
|
||||||
assert_equal Language['reStructuredText'], Language.find_by_alias('rst')
|
assert_equal Language['reStructuredText'], Language.find_by_alias('rst')
|
||||||
assert_equal Language['YAML'], Language.find_by_alias('yml')
|
assert_equal Language['YAML'], Language.find_by_alias('yml')
|
||||||
|
assert_nil Language.find_by_alias(nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_groups
|
def test_groups
|
||||||
@@ -221,6 +222,7 @@ class TestLanguage < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_find_by_name
|
def test_find_by_name
|
||||||
|
assert_nil Language.find_by_name(nil)
|
||||||
ruby = Language['Ruby']
|
ruby = Language['Ruby']
|
||||||
assert_equal ruby, Language.find_by_name('Ruby')
|
assert_equal ruby, Language.find_by_name('Ruby')
|
||||||
end
|
end
|
||||||
@@ -317,6 +319,7 @@ class TestLanguage < Test::Unit::TestCase
|
|||||||
assert_equal 'C#', Language['c#'].name
|
assert_equal 'C#', Language['c#'].name
|
||||||
assert_equal 'C#', Language['csharp'].name
|
assert_equal 'C#', Language['csharp'].name
|
||||||
assert_nil Language['defunkt']
|
assert_nil Language['defunkt']
|
||||||
|
assert_nil Language[nil]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_find_ignores_case
|
def test_find_ignores_case
|
||||||
|
|||||||
Reference in New Issue
Block a user