Skip to content

Commit

Permalink
Merge pull request #1354 from github/binary-language-mkII
Browse files Browse the repository at this point in the history
Ask Charlock earlier
  • Loading branch information
arfon committed Jul 7, 2014
2 parents 408a325 + bc7596a commit 4948ec2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/linguist/language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def self.detect(blob)
#
# We'll perform a more comprehensive test later which actually involves
# looking for binary characters in the blob
return nil if blob.likely_binary?
return nil if blob.likely_binary? || blob.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
Expand All @@ -124,7 +124,7 @@ def self.detect(blob)
possible_language_names = possible_languages.map(&:name)

# Don't bother with binary contents or an empty file
if blob.binary? || data.nil? || data == ""
if data.nil? || data == ""
nil
# Check if there's a shebang line and use that as authoritative
elsif (result = find_by_shebang(data)) && !result.empty?
Expand Down Expand Up @@ -401,7 +401,7 @@ def initialize(attributes = {})
#
# Returns the extensions Array
attr_reader :filenames

# Public: Return all possible extensions for language
def all_extensions
(extensions + [primary_extension]).uniq
Expand Down

0 comments on commit 4948ec2

Please sign in to comment.