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.
|
||||
def self.find_by_name(name)
|
||||
@name_index[name.downcase]
|
||||
name && @name_index[name.downcase]
|
||||
end
|
||||
|
||||
# Public: Look up Language by one of its aliases.
|
||||
@@ -178,7 +178,7 @@ module Linguist
|
||||
#
|
||||
# Returns the Lexer or nil if none was found.
|
||||
def self.find_by_alias(name)
|
||||
@alias_index[name.downcase]
|
||||
name && @alias_index[name.downcase]
|
||||
end
|
||||
|
||||
# Public: Look up Languages by filename.
|
||||
@@ -243,7 +243,7 @@ module Linguist
|
||||
#
|
||||
# Returns the Language or nil if none was found.
|
||||
def self.[](name)
|
||||
@index[name.downcase]
|
||||
name && @index[name.downcase]
|
||||
end
|
||||
|
||||
# Public: A List of popular languages
|
||||
|
||||
@@ -869,6 +869,7 @@ GAS:
|
||||
extensions:
|
||||
- .s
|
||||
- .S
|
||||
tm_scope: source.asm.x86
|
||||
|
||||
GDScript:
|
||||
type: programming
|
||||
@@ -1419,7 +1420,7 @@ Less:
|
||||
lexer: CSS
|
||||
extensions:
|
||||
- .less
|
||||
tm_scope: source.css
|
||||
tm_scope: source.css.less
|
||||
|
||||
LilyPond:
|
||||
lexer: Text only
|
||||
@@ -2096,6 +2097,7 @@ Python:
|
||||
- wscript
|
||||
- SConstruct
|
||||
- SConscript
|
||||
- BUILD
|
||||
interpreters:
|
||||
- python
|
||||
|
||||
@@ -2813,7 +2815,11 @@ XML:
|
||||
- .classpath
|
||||
- .project
|
||||
- build.xml.dist
|
||||
- packages.config
|
||||
- phpunit.xml.dist
|
||||
- Web.config
|
||||
- Web.Debug.config
|
||||
- Web.Release.config
|
||||
|
||||
XProc:
|
||||
type: programming
|
||||
@@ -2882,7 +2888,7 @@ Zephir:
|
||||
color: "#118f9e"
|
||||
extensions:
|
||||
- .zep
|
||||
tm_scope: text.html.php
|
||||
tm_scope: source.php.zephir
|
||||
|
||||
Zimpl:
|
||||
type: programming
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Linguist
|
||||
VERSION = "3.5.0"
|
||||
VERSION = "3.5.2"
|
||||
end
|
||||
|
||||
@@ -119,6 +119,7 @@ class TestLanguage < Test::Unit::TestCase
|
||||
assert_equal Language['VimL'], Language.find_by_alias('viml')
|
||||
assert_equal Language['reStructuredText'], Language.find_by_alias('rst')
|
||||
assert_equal Language['YAML'], Language.find_by_alias('yml')
|
||||
assert_nil Language.find_by_alias(nil)
|
||||
end
|
||||
|
||||
def test_groups
|
||||
@@ -221,6 +222,7 @@ class TestLanguage < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_find_by_name
|
||||
assert_nil Language.find_by_name(nil)
|
||||
ruby = Language['Ruby']
|
||||
assert_equal ruby, Language.find_by_name('Ruby')
|
||||
end
|
||||
@@ -317,6 +319,7 @@ class TestLanguage < Test::Unit::TestCase
|
||||
assert_equal 'C#', Language['c#'].name
|
||||
assert_equal 'C#', Language['csharp'].name
|
||||
assert_nil Language['defunkt']
|
||||
assert_nil Language[nil]
|
||||
end
|
||||
|
||||
def test_find_ignores_case
|
||||
|
||||
Reference in New Issue
Block a user