Kill attachment stuff, just use viewable

This commit is contained in:
Joshua Peek
2011-06-02 12:42:56 -05:00
parent 60f958e733
commit a12bde58e0
4 changed files with 71 additions and 153 deletions

View File

@@ -110,37 +110,6 @@ module Linguist
@content_type ||= Mime.content_type_for(extname)
end
# Public: Determine if the Pathname is a binary mime type.
#
# Returns true or false.
def binary?
@binary ||= language? ? false : Mime.binary?(extname)
end
# Public: Determine if the Pathname should be served as an
# attachment.
#
# Returns true or false.
def attachment?
@attachment ||= language? ? false : Mime.attachment?(extname)
end
# Public: Get the Content-Disposition header value
#
# This value is used when serving raw blobs.
#
# # => "attachment; filename=file.tar"
# # => "inline"
#
# Returns a content disposition String.
def disposition
if attachment?
"attachment; filename=#{EscapeUtils.escape_url(basename)}"
else
'inline'
end
end
def to_s
@path.dup
end