Navigation Menu

Skip to content

Commit

Permalink
Support Ruby 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 18, 2018
1 parent 7189855 commit 7c0e50a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/chupa-text/formatters/hash.rb
Expand Up @@ -52,8 +52,11 @@ def format_finish(data)
def format_headers(data, target)
format_header("mime-type", data.mime_type, target)
format_header("uri", data.uri, target)
if data.uri.class == URI::Generic
format_header("path", data.path, target)
case data.uri
when URI::HTTP, URI::FTP, nil
# No path
else
format_header("path", data.path, target)
end
format_header("size", data.size, target)
data.attributes.each do |name, value|
Expand Down

0 comments on commit 7c0e50a

Please sign in to comment.