Extract empty blob strategy

This commit is contained in:
Brandon Keepers
2014-11-03 08:21:46 -05:00
parent fd32938cd8
commit 815337299a
3 changed files with 14 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
module Linguist
module Strategy
class EmptyBlob
def self.call(blob, langauges)
# Don't bother with binary contents or an empty file
[] if blob.data.nil? || blob.data == ""
end
end
end
end

View File

@@ -1,5 +1,6 @@
module Linguist
module Strategy
# Check if there's a shebang line and use that as authoritative
class Shebang
def self.call(blob, _)
Language.find_by_shebang(blob.data)