Add Blob#binary?

This commit is contained in:
Joshua Peek
2011-05-13 12:54:16 -05:00
parent 6ead7d8f37
commit dec56649b2
2 changed files with 13 additions and 1 deletions

View File

@@ -26,8 +26,12 @@ module Linguist
defined?(Grit::Submodule) && @blob.kind_of?(Grit::Submodule)
end
def binary?
mime_type == 'octet-stream' || !(text? || image?)
end
def file?
image? || !text? || mime_type == 'octet-stream'
image? || binary?
end
def text?