Skip to content

Commit

Permalink
FIX: prefer non-obsolete types to obsolete ones
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Mar 28, 2017
1 parent d0e00b4 commit 3cd66be
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 66 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
28-03-2016

- Version 0.1.3
- Prefer non-obsolete mime types to obsolete ones

14-12-2016

- Version 0.1.2
Expand Down
9 changes: 7 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ task :rebuild_db do
buffer = []

index.each do |ext, list|
first = list.first
buffer << [ext.dup, first.content_type.dup, first.encoding.dup]
mime_type = nil
list.each do |type|
mime_type = type
break unless type.obsolete?
end
mime_type = list.first if mime_type.obsolete?
buffer << [ext.dup, mime_type.content_type.dup, mime_type.encoding.dup]
end

pad(buffer)
Expand Down
Loading

0 comments on commit 3cd66be

Please sign in to comment.