github-linguist 6.4.1 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bin/{linguist → github-linguist} +0 -0
- data/grammars/source.abap.json +35 -6
- data/grammars/source.apl.json +4 -8
- data/grammars/source.ballerina.json +82 -3
- data/grammars/source.bdf.json +419 -0
- data/grammars/source.c++.json +25 -3
- data/grammars/source.c.json +6 -3
- data/grammars/source.chapel.json +3 -3
- data/grammars/source.coq.json +2 -2
- data/grammars/source.cs.json +83 -73
- data/grammars/source.csound.json +1 -1
- data/grammars/source.dart.json +1 -1
- data/grammars/source.elixir.json +112 -137
- data/grammars/source.emacs.lisp.json +179 -4
- data/grammars/source.figctrl.json +252 -0
- data/grammars/source.figfont.json +121 -0
- data/grammars/source.fontdir.json +99 -0
- data/grammars/source.fstar.json +439 -0
- data/grammars/source.hx.json +27 -9
- data/grammars/source.j.json +260 -0
- data/grammars/source.julia.json +24 -12
- data/grammars/source.lisp.json +3 -3
- data/grammars/source.mupad.json +1 -1
- data/grammars/source.pony.json +3 -3
- data/grammars/source.powershell.json +2 -2
- data/grammars/source.protobuf.json +87 -5
- data/grammars/source.purescript.json +5 -2
- data/grammars/source.python.json +17 -12
- data/grammars/source.rascal.json +0 -1
- data/grammars/source.reg.json +159 -0
- data/grammars/source.slice.json +2755 -0
- data/grammars/source.solidity.json +2 -2
- data/grammars/source.ts.json +225 -132
- data/grammars/source.tsx.json +235 -142
- data/grammars/source.viml.json +4 -4
- data/grammars/source.xlfd.json +462 -0
- data/grammars/source.yasnippet.json +387 -0
- data/grammars/text.elixir.json +17 -5
- data/grammars/text.html.basic.json +622 -2264
- data/grammars/text.html.elixir.json +10 -1
- data/grammars/text.html.php.blade.json +7 -3
- data/grammars/version +1 -0
- data/lib/linguist.rb +2 -0
- data/lib/linguist/VERSION +1 -1
- data/lib/linguist/generated.rb +14 -1
- data/lib/linguist/heuristics.rb +77 -468
- data/lib/linguist/heuristics.yml +404 -0
- data/lib/linguist/languages.json +1 -1
- data/lib/linguist/languages.yml +86 -6
- data/lib/linguist/samples.json +2624 -483
- data/lib/linguist/strategy/xml.rb +30 -0
- metadata +20 -7
@@ -0,0 +1,30 @@
|
|
1
|
+
module Linguist
|
2
|
+
module Strategy
|
3
|
+
# Detects XML files based on root tag.
|
4
|
+
class XML
|
5
|
+
# Scope of the search for the root tag
|
6
|
+
# Number of lines to check at the beginning of the file
|
7
|
+
SEARCH_SCOPE = 2
|
8
|
+
|
9
|
+
# Public: Use the root tag to detect the XML blobs, only if no other
|
10
|
+
# candidates were previously identified.
|
11
|
+
#
|
12
|
+
# blob - An object that quacks like a blob.
|
13
|
+
# candidates - A list of candidate languages.
|
14
|
+
#
|
15
|
+
# Examples
|
16
|
+
#
|
17
|
+
# XML.call(FileBlob.new("path/to/file"))
|
18
|
+
#
|
19
|
+
# Returns the list of candidates if it wasn't empty, an array with the
|
20
|
+
# XML language as sole item if the root tag is detected, and an empty
|
21
|
+
# Array otherwise.
|
22
|
+
def self.call(blob, candidates = [])
|
23
|
+
return candidates if candidates.any?
|
24
|
+
|
25
|
+
header = blob.first_lines(SEARCH_SCOPE).join("\n")
|
26
|
+
/<?xml version=/.match(header) ? [Language["XML"]] : []
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
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
|
+
version: 7.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: 2018-
|
11
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: charlock_holmes
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 1.
|
187
|
+
version: 1.3.0
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 1.
|
194
|
+
version: 1.3.0
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: licensee
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -211,7 +211,7 @@ description: We use this library at GitHub to detect blob languages, highlight c
|
|
211
211
|
graphs.
|
212
212
|
email:
|
213
213
|
executables:
|
214
|
-
- linguist
|
214
|
+
- github-linguist
|
215
215
|
- git-linguist
|
216
216
|
extensions:
|
217
217
|
- ext/linguist/extconf.rb
|
@@ -219,7 +219,7 @@ extra_rdoc_files: []
|
|
219
219
|
files:
|
220
220
|
- LICENSE
|
221
221
|
- bin/git-linguist
|
222
|
-
- bin/linguist
|
222
|
+
- bin/github-linguist
|
223
223
|
- ext/linguist/extconf.rb
|
224
224
|
- ext/linguist/lex.linguist_yy.c
|
225
225
|
- ext/linguist/lex.linguist_yy.h
|
@@ -268,6 +268,7 @@ files:
|
|
268
268
|
- grammars/source.awk.json
|
269
269
|
- grammars/source.ballerina.json
|
270
270
|
- grammars/source.batchfile.json
|
271
|
+
- grammars/source.bdf.json
|
271
272
|
- grammars/source.befunge.json
|
272
273
|
- grammars/source.bf.json
|
273
274
|
- grammars/source.bison.json
|
@@ -342,8 +343,11 @@ files:
|
|
342
343
|
- grammars/source.factor.json
|
343
344
|
- grammars/source.fan.json
|
344
345
|
- grammars/source.fancy.json
|
346
|
+
- grammars/source.figctrl.json
|
347
|
+
- grammars/source.figfont.json
|
345
348
|
- grammars/source.firestore.json
|
346
349
|
- grammars/source.fish.json
|
350
|
+
- grammars/source.fontdir.json
|
347
351
|
- grammars/source.fontforge.json
|
348
352
|
- grammars/source.forth.json
|
349
353
|
- grammars/source.fortran.json
|
@@ -352,6 +356,7 @@ files:
|
|
352
356
|
- grammars/source.fsharp.fsl.json
|
353
357
|
- grammars/source.fsharp.fsx.json
|
354
358
|
- grammars/source.fsharp.json
|
359
|
+
- grammars/source.fstar.json
|
355
360
|
- grammars/source.gap.json
|
356
361
|
- grammars/source.gcode.json
|
357
362
|
- grammars/source.gdb.json
|
@@ -391,6 +396,7 @@ files:
|
|
391
396
|
- grammars/source.ioke.json
|
392
397
|
- grammars/source.isabelle.root.json
|
393
398
|
- grammars/source.isabelle.theory.json
|
399
|
+
- grammars/source.j.json
|
394
400
|
- grammars/source.jasmin.json
|
395
401
|
- grammars/source.java-properties.json
|
396
402
|
- grammars/source.java.json
|
@@ -520,6 +526,7 @@ files:
|
|
520
526
|
- grammars/source.reason.json
|
521
527
|
- grammars/source.rebol.json
|
522
528
|
- grammars/source.red.json
|
529
|
+
- grammars/source.reg.json
|
523
530
|
- grammars/source.regexp.babel.json
|
524
531
|
- grammars/source.regexp.extended.json
|
525
532
|
- grammars/source.regexp.json
|
@@ -547,6 +554,7 @@ files:
|
|
547
554
|
- grammars/source.shaderlab.json
|
548
555
|
- grammars/source.shell.json
|
549
556
|
- grammars/source.shen.json
|
557
|
+
- grammars/source.slice.json
|
550
558
|
- grammars/source.smali.json
|
551
559
|
- grammars/source.smalltalk.json
|
552
560
|
- grammars/source.smt.json
|
@@ -594,6 +602,7 @@ files:
|
|
594
602
|
- grammars/source.x86.json
|
595
603
|
- grammars/source.x86asm.json
|
596
604
|
- grammars/source.xc.json
|
605
|
+
- grammars/source.xlfd.json
|
597
606
|
- grammars/source.xq.json
|
598
607
|
- grammars/source.xtend.json
|
599
608
|
- grammars/source.yaml-ext.json
|
@@ -601,6 +610,7 @@ files:
|
|
601
610
|
- grammars/source.yaml.salt.json
|
602
611
|
- grammars/source.yang.json
|
603
612
|
- grammars/source.yara.json
|
613
|
+
- grammars/source.yasnippet.json
|
604
614
|
- grammars/text.bibtex.json
|
605
615
|
- grammars/text.cfml.basic.json
|
606
616
|
- grammars/text.elixir.json
|
@@ -673,6 +683,7 @@ files:
|
|
673
683
|
- grammars/text.xml.pom.json
|
674
684
|
- grammars/text.xml.xsl.json
|
675
685
|
- grammars/text.zone_file.json
|
686
|
+
- grammars/version
|
676
687
|
- lib/linguist.rb
|
677
688
|
- lib/linguist/VERSION
|
678
689
|
- lib/linguist/blob.rb
|
@@ -683,6 +694,7 @@ files:
|
|
683
694
|
- lib/linguist/generated.rb
|
684
695
|
- lib/linguist/grammars.rb
|
685
696
|
- lib/linguist/heuristics.rb
|
697
|
+
- lib/linguist/heuristics.yml
|
686
698
|
- lib/linguist/language.rb
|
687
699
|
- lib/linguist/languages.json
|
688
700
|
- lib/linguist/languages.yml
|
@@ -697,6 +709,7 @@ files:
|
|
697
709
|
- lib/linguist/strategy/extension.rb
|
698
710
|
- lib/linguist/strategy/filename.rb
|
699
711
|
- lib/linguist/strategy/modeline.rb
|
712
|
+
- lib/linguist/strategy/xml.rb
|
700
713
|
- lib/linguist/tokenizer.rb
|
701
714
|
- lib/linguist/vendor.yml
|
702
715
|
- lib/linguist/version.rb
|
@@ -720,7 +733,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
720
733
|
version: '0'
|
721
734
|
requirements: []
|
722
735
|
rubyforge_project:
|
723
|
-
rubygems_version: 2.
|
736
|
+
rubygems_version: 2.6.14
|
724
737
|
signing_key:
|
725
738
|
specification_version: 4
|
726
739
|
summary: GitHub Language detection
|