mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Merge branch 'master' into 1515-local
This commit is contained in:
@@ -63,6 +63,7 @@ module Linguist
|
||||
generated_jni_header? ||
|
||||
composer_lock? ||
|
||||
node_modules? ||
|
||||
godeps? ||
|
||||
vcr_cassette? ||
|
||||
generated_by_zephir?
|
||||
end
|
||||
@@ -231,6 +232,14 @@ module Linguist
|
||||
!!name.match(/node_modules\//)
|
||||
end
|
||||
|
||||
# Internal: Is the blob part of Godeps/,
|
||||
# which are not meant for humans in pull requests.
|
||||
#
|
||||
# Returns true or false.
|
||||
def godeps?
|
||||
!!name.match(/Godeps\//)
|
||||
end
|
||||
|
||||
# Internal: Is the blob a generated php composer lock file?
|
||||
#
|
||||
# Returns true or false.
|
||||
|
||||
@@ -19,6 +19,9 @@ module Linguist
|
||||
if languages.all? { |l| ["ECL", "Prolog"].include?(l) }
|
||||
result = disambiguate_ecl(data, languages)
|
||||
end
|
||||
if languages.all? { |l| ["Common Lisp", "OpenCL"].include?(l) }
|
||||
result = disambiguate_cl(data, languages)
|
||||
end
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
||||
@@ -136,7 +136,7 @@ module Linguist
|
||||
elsif (determined = Heuristics.find_by_heuristics(data, possible_language_names)) && !determined.empty?
|
||||
determined.first
|
||||
# Lastly, fall back to the probabilistic classifier.
|
||||
elsif classified = Classifier.classify(Samples::DATA, data, possible_language_names).first
|
||||
elsif classified = Classifier.classify(Samples.cache, data, possible_language_names).first
|
||||
# Return the actual Language object based of the string language name (i.e., first element of `#classify`)
|
||||
Language[classified[0]]
|
||||
end
|
||||
@@ -510,9 +510,9 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
extensions = Samples::DATA['extnames']
|
||||
interpreters = Samples::DATA['interpreters']
|
||||
filenames = Samples::DATA['filenames']
|
||||
extensions = Samples.cache['extnames']
|
||||
interpreters = Samples.cache['interpreters']
|
||||
filenames = Samples.cache['filenames']
|
||||
popular = YAML.load_file(File.expand_path("../popular.yml", __FILE__))
|
||||
|
||||
languages_yml = File.expand_path("../languages.yml", __FILE__)
|
||||
|
||||
@@ -748,6 +748,7 @@ Forth:
|
||||
- .fth
|
||||
- .4th
|
||||
- .forth
|
||||
- .frt
|
||||
|
||||
Frege:
|
||||
type: programming
|
||||
@@ -891,6 +892,12 @@ Grammatical Framework:
|
||||
searchable: true
|
||||
color: "#ff0000"
|
||||
|
||||
Graph Modeling Language:
|
||||
type: data
|
||||
lexer: Text only
|
||||
extensions:
|
||||
- .gml
|
||||
|
||||
Groff:
|
||||
extensions:
|
||||
- .man
|
||||
@@ -1163,6 +1170,7 @@ JavaScript:
|
||||
- .es6
|
||||
- .frag
|
||||
- .jake
|
||||
- .jsb
|
||||
- .jsfl
|
||||
- .jsm
|
||||
- .jss
|
||||
@@ -1718,6 +1726,7 @@ Pascal:
|
||||
- .dfm
|
||||
- .dpr
|
||||
- .lpr
|
||||
- .pp
|
||||
|
||||
Perl:
|
||||
type: programming
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,9 +17,11 @@ module Linguist
|
||||
PATH = File.expand_path('../samples.json', __FILE__)
|
||||
|
||||
# Hash of serialized samples object
|
||||
if File.exist?(PATH)
|
||||
serializer = defined?(JSON) ? JSON : YAML
|
||||
DATA = serializer.load(File.read(PATH))
|
||||
def self.cache
|
||||
@cache ||= begin
|
||||
serializer = defined?(JSON) ? JSON : YAML
|
||||
serializer.load(File.read(PATH))
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Iterate over each sample.
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
# Erlang bundles
|
||||
- ^rebar$
|
||||
|
||||
# Go dependencies
|
||||
- Godeps/_workspace/
|
||||
|
||||
# Bootstrap minified css and js
|
||||
- (^|/)bootstrap([^.]*)(\.min)?\.(js|css)$
|
||||
|
||||
@@ -235,3 +238,7 @@
|
||||
- octicons.css
|
||||
- octicons.min.css
|
||||
- sprockets-octicons.scss
|
||||
|
||||
# Typesafe Activator
|
||||
- (^|/)activator$
|
||||
- (^|/)activator\.bat$
|
||||
|
||||
Reference in New Issue
Block a user