Merge remote-tracking branch 'github/master' into chapel-lang

Conflicts:
	lib/linguist/samples.json
This commit is contained in:
Thomas Van Doren
2014-07-05 11:52:58 -07:00
9 changed files with 116 additions and 10858 deletions

View File

@@ -92,13 +92,20 @@ module Linguist
# Public: Detects the Language of the blob.
#
# blob - an object that implements the Linguist `Blob` interface;
# blob - an object that includes the Linguist `BlobHelper` interface;
# see Linguist::LazyBlob and Linguist::FileBlob for examples
#
# Returns Language or nil.
def self.detect(blob)
name = blob.name.to_s
# Check if the blob is possibly binary and bail early; this is a cheap
# test that uses the extension name to guess a binary binary mime type.
#
# We'll perform a more comprehensive test later which actually involves
# looking for binary characters in the blob
return nil if blob.likely_binary?
# A bit of an elegant hack. If the file is executable but extensionless,
# append a "magic" extension so it can be classified with other
# languages that have shebang scripts.
@@ -116,8 +123,8 @@ module Linguist
data = blob.data
possible_language_names = possible_languages.map(&:name)
# Don't bother with emptiness
if data.nil? || data == ""
# Don't bother with binary contents or an empty file
if blob.binary? || data.nil? || data == ""
nil
# Check if there's a shebang line and use that as authoritative
elsif (result = find_by_shebang(data)) && !result.empty?

View File

@@ -157,7 +157,6 @@ Assembly:
- nasm
extensions:
- .asm
- .inc
Augeas:
type: programming
@@ -1915,6 +1914,7 @@ Ruby:
- Jarfile
- Mavenfile
- Podfile
- Puppetfile
- Thorfile
- Vagrantfile
- buildfile

File diff suppressed because it is too large Load Diff

View File

@@ -125,6 +125,9 @@
## Obj-C ##
# Cocoapods
- ^Pods/
# Sparkle
- (^|/)Sparkle/

View File

@@ -1,3 +1,3 @@
module Linguist
VERSION = "3.0.0"
VERSION = "3.0.2"
end