mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Merge branch 'master' into 979
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = 'github-linguist'
|
s.name = 'github-linguist'
|
||||||
s.version = '2.10.11'
|
s.version = '2.10.12'
|
||||||
s.summary = "GitHub Language detection"
|
s.summary = "GitHub Language detection"
|
||||||
s.description = 'We use this library at GitHub to detect blob languages, highlight code, ignore binary files, suppress generated files in diffs, and generate language breakdown graphs.'
|
s.description = 'We use this library at GitHub to detect blob languages, highlight code, ignore binary files, suppress generated files in diffs, and generate language breakdown graphs.'
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ module Linguist
|
|||||||
generated_protocol_buffer? ||
|
generated_protocol_buffer? ||
|
||||||
generated_jni_header? ||
|
generated_jni_header? ||
|
||||||
composer_lock? ||
|
composer_lock? ||
|
||||||
node_modules?
|
node_modules? ||
|
||||||
|
vcr_cassette?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Internal: Is the blob an XCode project file?
|
# Internal: Is the blob an XCode project file?
|
||||||
@@ -235,5 +236,15 @@ module Linguist
|
|||||||
def composer_lock?
|
def composer_lock?
|
||||||
!!name.match(/composer.lock/)
|
!!name.match(/composer.lock/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Is the blob a VCR Cassette file?
|
||||||
|
#
|
||||||
|
# Returns true or false
|
||||||
|
def vcr_cassette?
|
||||||
|
return false unless extname == '.yml'
|
||||||
|
return false unless lines.count > 2
|
||||||
|
# VCR Cassettes have "recorded_with: VCR" in the second last line.
|
||||||
|
return lines[-2].include?("recorded_with: VCR")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -254,6 +254,7 @@ C++:
|
|||||||
extensions:
|
extensions:
|
||||||
- .C
|
- .C
|
||||||
- .c++
|
- .c++
|
||||||
|
- .cc
|
||||||
- .cxx
|
- .cxx
|
||||||
- .H
|
- .H
|
||||||
- .h++
|
- .h++
|
||||||
@@ -491,6 +492,9 @@ Dylan:
|
|||||||
type: programming
|
type: programming
|
||||||
color: "#3ebc27"
|
color: "#3ebc27"
|
||||||
primary_extension: .dylan
|
primary_extension: .dylan
|
||||||
|
extensions:
|
||||||
|
- .intr
|
||||||
|
- .lid
|
||||||
|
|
||||||
Ecere Projects:
|
Ecere Projects:
|
||||||
type: data
|
type: data
|
||||||
@@ -556,6 +560,14 @@ F#:
|
|||||||
- .fsi
|
- .fsi
|
||||||
- .fsx
|
- .fsx
|
||||||
|
|
||||||
|
FLUX:
|
||||||
|
type: programming
|
||||||
|
color: "#33CCFF"
|
||||||
|
primary_extension: .fx
|
||||||
|
lexer: Text only
|
||||||
|
extensions:
|
||||||
|
- .flux
|
||||||
|
|
||||||
FORTRAN:
|
FORTRAN:
|
||||||
type: programming
|
type: programming
|
||||||
lexer: Fortran
|
lexer: Fortran
|
||||||
@@ -594,7 +606,7 @@ Fancy:
|
|||||||
- .fancypack
|
- .fancypack
|
||||||
filenames:
|
filenames:
|
||||||
- Fakefile
|
- Fakefile
|
||||||
|
|
||||||
Fantom:
|
Fantom:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#dbded5"
|
color: "#dbded5"
|
||||||
@@ -1846,6 +1858,7 @@ XML:
|
|||||||
- .kml
|
- .kml
|
||||||
- .launch
|
- .launch
|
||||||
- .mxml
|
- .mxml
|
||||||
|
- .osm
|
||||||
- .plist
|
- .plist
|
||||||
- .pluginspec
|
- .pluginspec
|
||||||
- .ps1xml
|
- .ps1xml
|
||||||
|
|||||||
@@ -117,6 +117,13 @@
|
|||||||
# Sparkle
|
# Sparkle
|
||||||
- (^|/)Sparkle/
|
- (^|/)Sparkle/
|
||||||
|
|
||||||
|
## Groovy ##
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
- (^|/)gradlew$
|
||||||
|
- (^|/)gradlew\.bat$
|
||||||
|
- (^|/)gradle/wrapper/
|
||||||
|
|
||||||
## .NET ##
|
## .NET ##
|
||||||
|
|
||||||
# Visual Studio IntelliSense
|
# Visual Studio IntelliSense
|
||||||
|
|||||||
20
samples/YAML/vcr_cassette.yml
Normal file
20
samples/YAML/vcr_cassette.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
http_interactions:
|
||||||
|
- request:
|
||||||
|
method: get
|
||||||
|
uri: http://example.com/
|
||||||
|
body: ''
|
||||||
|
headers: {}
|
||||||
|
response:
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
|
headers:
|
||||||
|
Content-Type:
|
||||||
|
- text/html;charset=utf-8
|
||||||
|
Content-Length:
|
||||||
|
- '26'
|
||||||
|
body: This is the response body
|
||||||
|
http_version: '1.1'
|
||||||
|
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
||||||
|
recorded_with: VCR 2.0.0
|
||||||
@@ -211,6 +211,9 @@ class TestBlob < Test::Unit::TestCase
|
|||||||
assert !blob("CSS/bootstrap.css").generated?
|
assert !blob("CSS/bootstrap.css").generated?
|
||||||
assert blob("CSS/bootstrap.min.css").generated?
|
assert blob("CSS/bootstrap.min.css").generated?
|
||||||
|
|
||||||
|
# Generated VCR
|
||||||
|
assert blob("YAML/vcr_cassette.yml").generated?
|
||||||
|
|
||||||
assert Linguist::Generated.generated?("node_modules/grunt/lib/grunt.js", nil)
|
assert Linguist::Generated.generated?("node_modules/grunt/lib/grunt.js", nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -343,6 +346,14 @@ class TestBlob < Test::Unit::TestCase
|
|||||||
|
|
||||||
# Vagrant
|
# Vagrant
|
||||||
assert blob("Vagrantfile").vendored?
|
assert blob("Vagrantfile").vendored?
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
assert blob("gradlew").vendored?
|
||||||
|
assert blob("gradlew.bat").vendored?
|
||||||
|
assert blob("gradle/wrapper/gradle-wrapper.properties").vendored?
|
||||||
|
assert blob("subproject/gradlew").vendored?
|
||||||
|
assert blob("subproject/gradlew.bat").vendored?
|
||||||
|
assert blob("subproject/gradle/wrapper/gradle-wrapper.properties").vendored?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_language
|
def test_language
|
||||||
|
|||||||
Reference in New Issue
Block a user