Default to not binary

This commit is contained in:
Joshua Peek
2011-06-02 15:20:50 -05:00
parent a12bde58e0
commit d9990aed06
4 changed files with 87 additions and 9 deletions

View File

@@ -88,7 +88,7 @@ module Linguist
# Returns true or false
def self.binary?(ext_or_mime_type)
mime_type = lookup_mime_type_for(ext_or_mime_type)
mime_type.nil? || mime_type.binary?
mime_type ? mime_type.binary? : false
end
# Internal: Lookup mime type for extension or mime type

View File

@@ -49,11 +49,43 @@ application/x-wais-source:
application/vnd.mozilla.xul+xml:
binary: false
application/vnd.adobe.air-application-installer-package+zip:
binary: true
extensions:
- air
application/octet-stream:
binary: true
extensions:
- dmg
# TODO: Lookup actual content type for these extensions
- a
- blend
- dll
- dmg
- gem
- graffle
- ipa
- lib
- mcz
- nib
- o
- odp
- ods
- odt
- otf
- ogv
- pfx
- pigx
- plgx
- pptx
- psd
- sib
- so
- spl
- sqlite3
- swc
- ucode
- xpi
application/java-archive:
binary: true
@@ -61,6 +93,16 @@ application/java-archive:
- ear
- war
application/x-chrome-extension:
binary: true
extensions:
- crx
application/x-debian-package:
binary: true
extensions:
- deb
application/x-shockwave-flash:
binary: true
extensions:
@@ -74,3 +116,18 @@ image/jpeg:
image/png:
attachment: false
image/x-icns:
binary: true
extensions:
- icns
text/cache-manifest:
extensions:
- manifest
video/quicktime:
binary: true
extensions:
- qt
- mov