Created
January 11, 2012 21:30
-
-
Save sunnygleason/1596855 to your computer and use it in GitHub Desktop.
File Extensions by MIME Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mime/types' | |
ARGV.each do |mime_type| | |
mimes = MIME::Types[mime_type] | |
exts = [] | |
mimes && mimes.each do |mime| | |
mime.extensions.each { |x| exts << x } | |
end | |
puts "#{mime_type} extensions : #{exts.join(',')}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment