github-linguist 4.8.18 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/hint.haskell.json +11 -8
  3. data/grammars/hint.message.haskell.json +11 -8
  4. data/grammars/hint.type.haskell.json +11 -8
  5. data/grammars/source.abnf.json +20 -9
  6. data/grammars/source.ahk.json +1 -1
  7. data/grammars/source.bsl.json +1 -1
  8. data/grammars/source.c.json +0 -4
  9. data/grammars/source.c.platform.json +93 -14
  10. data/grammars/source.coffee.json +2 -2
  11. data/grammars/source.cs.json +29 -5
  12. data/grammars/source.csound-score.json +57 -30
  13. data/grammars/source.csound.json +44 -4
  14. data/grammars/source.dm.json +1 -1
  15. data/grammars/source.haskell.json +11 -8
  16. data/grammars/source.js.json +116 -62
  17. data/grammars/source.lean.json +1 -1
  18. data/grammars/source.llvm.json +2 -2
  19. data/grammars/source.mask.json +27 -1
  20. data/grammars/source.objc.platform.json +57 -14
  21. data/grammars/source.perl.json +1 -1
  22. data/grammars/source.perl6fe.json +165 -54
  23. data/grammars/source.pony.json +1 -1
  24. data/grammars/source.python.json +2061 -289
  25. data/grammars/source.rascal.json +3 -4
  26. data/grammars/source.regexp.python.json +34 -4
  27. data/grammars/source.sdbl.json +6 -2
  28. data/grammars/source.swift.json +182 -58
  29. data/grammars/source.viml.json +1 -1
  30. data/grammars/source.yaml.json +2 -0
  31. data/grammars/text.html.handlebars.json +3 -3
  32. data/grammars/text.html.php.json +2 -2
  33. data/grammars/text.html.vue.json +42 -1
  34. data/grammars/text.tex.latex.haskell.json +11 -8
  35. data/lib/linguist.rb +2 -1
  36. data/lib/linguist/language.rb +20 -69
  37. data/lib/linguist/languages.json +1 -1
  38. data/lib/linguist/languages.yml +95 -119
  39. data/lib/linguist/popular.yml +1 -1
  40. data/lib/linguist/samples.json +2330 -2330
  41. data/lib/linguist/strategy/extension.rb +10 -0
  42. data/lib/linguist/strategy/filename.rb +3 -2
  43. data/lib/linguist/version.rb +1 -1
  44. metadata +3 -3
  45. data/grammars/source.js.embedded.html.json +0 -10
@@ -0,0 +1,10 @@
1
+ module Linguist
2
+ module Strategy
3
+ # Detects language based on extension
4
+ class Extension
5
+ def self.call(blob, _)
6
+ Language.find_by_extension(blob.name.to_s)
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,9 +1,10 @@
1
1
  module Linguist
2
2
  module Strategy
3
- # Detects language based on filename and/or extension
3
+ # Detects language based on filename
4
4
  class Filename
5
5
  def self.call(blob, _)
6
- Language.find_by_filename(blob.name.to_s)
6
+ name = blob.name.to_s
7
+ Language.find_by_filename(name)
7
8
  end
8
9
  end
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module Linguist
2
- VERSION = "4.8.18"
2
+ VERSION = "5.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-linguist
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.18
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-07 00:00:00.000000000 Z
11
+ date: 2016-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charlock_holmes
@@ -361,7 +361,6 @@ files:
361
361
  - grammars/source.jcl.json
362
362
  - grammars/source.jflex.json
363
363
  - grammars/source.jq.json
364
- - grammars/source.js.embedded.html.json
365
364
  - grammars/source.js.json
366
365
  - grammars/source.js.jsx.json
367
366
  - grammars/source.js.objj.json
@@ -618,6 +617,7 @@ files:
618
617
  - lib/linguist/samples.json
619
618
  - lib/linguist/samples.rb
620
619
  - lib/linguist/shebang.rb
620
+ - lib/linguist/strategy/extension.rb
621
621
  - lib/linguist/strategy/filename.rb
622
622
  - lib/linguist/strategy/modeline.rb
623
623
  - lib/linguist/tokenizer.rb
@@ -1,10 +0,0 @@
1
- {
2
- "scopeName": "source.js.embedded.html",
3
- "name": "Embedded JavaScript",
4
- "injectionSelector": "L:source.js.embedded.html, L:source.js.embedded.xml",
5
- "patterns": [
6
- {
7
- "match": "(?=</(?i:script)\\s*>)"
8
- }
9
- ]
10
- }