Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Priority extensions #49

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .hoerc
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ exclude: !ruby/regexp '/
)$
|
\.gemspec$
|
Vagrantfile$
/x'
42 changes: 41 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@ require "rubygems"
require "hoe"
require "rake/clean"

# This is required until https://github.com/seattlerb/hoe/issues/112 is fixed
class Hoe
def with_config
config = Hoe::DEFAULT_CONFIG

rc = File.expand_path("~/.hoerc")
homeconfig = load_config(rc)
config = config.merge(homeconfig)

localconfig = load_config(File.expand_path(File.join(Dir.pwd, ".hoerc")))
config = config.merge(localconfig)

yield config, rc
end

def load_config(name)
File.exist?(name) ? safe_load_yaml(name) : {}
end

def safe_load_yaml(name)
return safe_load_yaml_file(name) if YAML.respond_to?(:safe_load_file)

data = IO.binread(name)
YAML.safe_load(data, permitted_classes: [Regexp])
rescue
YAML.safe_load(data, [Regexp])
end

def safe_load_yaml_file(name)
YAML.safe_load_file(name, permitted_classes: [Regexp])
rescue
YAML.safe_load_file(name, [Regexp])
end
end

Hoe.plugin :doofus
Hoe.plugin :gemspec2
Hoe.plugin :git
Expand Down Expand Up @@ -105,6 +140,11 @@ namespace :convert do
require "convert/mini_mime_db"
Convert::MiniMimeDb.from_yaml_to_mini_mime(args)
end

task :yaml, [:source, :destination] => :support do |_, args|
require "convert"
Convert.from_yaml_to_yaml(args)
end
end

namespace :json do
Expand All @@ -120,7 +160,7 @@ namespace :update do
desc "Update the release version"
task :version do
file = IO.read("lib/mime/types/data.rb")
updated = file.sub(/VERSION = ['"][.0-9]+['"]/, %Q(VERSION = "#{new_version}"))
updated = file.sub(/VERSION = ['"][.0-9]+['"]/, %(VERSION = "#{new_version}"))

IO.write("lib/mime/types/data.rb", updated)
end
Expand Down
37 changes: 12 additions & 25 deletions data/content_type_mime.db
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ cdmic application/cdmi-container
cdmid application/cdmi-domain base64
cdmio application/cdmi-object base64
cdmiq application/cdmi-queue base64
cu application/cu-seeme base64
davmount application/davmount+xml base64
dcm application/dicom base64
dbk application/docbook+xml base64
Expand Down Expand Up @@ -88,19 +87,18 @@ roa application/rpki-roa
rsd application/rsd+xml base64
rss application/rss+xml base64
rtf application/rtf base64
rtx application/rtx base64
sbml application/sbml+xml base64
scq application/scvp-cv-request base64
scs application/scvp-cv-response base64
spq application/scvp-vp-request base64
spp application/scvp-vp-response base64
sdp application/sdp base64
setpay application/set-payment-initiation base64
setreg application/set-registration-initiation base64
sgml application/sgml base64
soc application/sgml-open-catalog base64
shf application/shf+xml base64
siv application/sieve base64
smi application/smil+xml 8bit
smil application/smil+xml 8bit
rq application/sparql-query base64
srx application/sparql-results+xml base64
gram application/srgs base64
Expand Down Expand Up @@ -312,7 +310,6 @@ cab application/vnd.ms-cab-compressed
xls application/vnd.ms-excel base64
xlam application/vnd.ms-excel.addin.macroEnabled.12 base64
xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12 base64
xlsm application/vnd.ms-excel.sheet.macroEnabled.12 base64
xltm application/vnd.ms-excel.template.macroEnabled.12 base64
eot application/vnd.ms-fontobject base64
chm application/vnd.ms-htmlhelp base64
Expand Down Expand Up @@ -351,15 +348,12 @@ rpss application/vnd.nokia.radio-presets
edm application/vnd.novadigm.EDM base64
edx application/vnd.novadigm.EDX base64
ext application/vnd.novadigm.EXT base64
odc application/vnd.oasis.opendocument.chart base64
odc application/vnd.oasis.opendocument.chart-template base64
otc application/vnd.oasis.opendocument.chart-template base64
odb application/vnd.oasis.opendocument.database base64
odf application/vnd.oasis.opendocument.formula base64
odf application/vnd.oasis.opendocument.formula-template base64
odft application/vnd.oasis.opendocument.formula-template base64
odg application/vnd.oasis.opendocument.graphics base64
otg application/vnd.oasis.opendocument.graphics-template base64
odi application/vnd.oasis.opendocument.image base64
odi application/vnd.oasis.opendocument.image-template base64
oti application/vnd.oasis.opendocument.image-template base64
odp application/vnd.oasis.opendocument.presentation base64
otp application/vnd.oasis.opendocument.presentation-template base64
ods application/vnd.oasis.opendocument.spreadsheet base64
Expand Down Expand Up @@ -446,7 +440,6 @@ sus application/vnd.sus-calendar
svd application/vnd.svd base64
sis application/vnd.symbian.install base64
xsm application/vnd.syncml+xml base64
bdm application/vnd.syncml.dm+wbxml base64
xdm application/vnd.syncml.dm+xml base64
tao application/vnd.tao.intent-module-archive base64
cap application/vnd.tcpdump.pcap base64
Expand Down Expand Up @@ -562,16 +555,13 @@ cpt application/x-mac-compactpro
mie application/x-mie base64
mobi application/x-mobipocket-ebook base64
application application/x-ms-application base64
exe application/x-ms-dos-executable base64
lnk application/x-ms-shortcut base64
wmd application/x-ms-wmd base64
wmz application/x-ms-wmz base64
xbap application/x-ms-xbap base64
mda application/x-msaccess base64
obd application/x-msbinder base64
crd application/x-mscardfile base64
clp application/x-msclip base64
cmd application/x-msdos-program base64
exe application/x-msdownload base64
m13 application/x-msmediaview base64
emf application/x-msmetafile base64
Expand Down Expand Up @@ -629,7 +619,6 @@ xdf application/xcap-diff+xml
xenc application/xenc+xml base64
xht application/xhtml+xml 8bit
xml application/xml 8bit
dtd application/xml-dtd 8bit
xop application/xop+xml base64
xpl application/xproc+xml base64
xslt application/xslt+xml base64
Expand All @@ -646,11 +635,12 @@ smv audio/SMV
adp audio/adpcm base64
au audio/basic base64
kar audio/midi base64
mp4 audio/mp4 base64
m4a audio/mp4 base64
mpga audio/mpeg base64
oga audio/ogg base64
s3m audio/s3m base64
sil audio/silk base64
mid audio/sp-midi base64
uva audio/vnd.dece.audio base64
eol audio/vnd.digital-winds 7bit
dra audio/vnd.dra base64
Expand Down Expand Up @@ -768,17 +758,16 @@ xcf image/x-xcf
xpm image/x-xpixmap 8bit
xwd image/x-xwindowdump base64
eml message/rfc822 8bit
igs model/iges base64
msh model/mesh base64
iges model/iges base64
mesh model/mesh base64
dae model/vnd.collada+xml base64
dwf model/vnd.dwf base64
gdl model/vnd.gdl base64
gtw model/vnd.gtw base64
mts model/vnd.mts base64
x_b model/vnd.parasolid.transmit.binary base64
x_t model/vnd.parasolid.transmit.text quoted-printable
xmt_bin model/vnd.parasolid.transmit.binary base64
xmt_txt model/vnd.parasolid.transmit.text quoted-printable
vtu model/vnd.vtu base64
wrl model/vrml base64
vrml model/vrml base64
x3db model/x3d+binary base64
x3dv model/x3d+vrml base64
x3d model/x3d+xml base64
Expand All @@ -791,7 +780,6 @@ markdown text/markdown
n3 text/n3 quoted-printable
txt text/plain quoted-printable
dsc text/prs.lines.tag quoted-printable
rtx text/richtext 8bit
sgml text/sgml quoted-printable
tsv text/tab-separated-values quoted-printable
t text/troff 8bit
Expand Down Expand Up @@ -828,7 +816,6 @@ uu text/x-uuencode
vcs text/x-vcalendar 8bit
vcf text/x-vcard 8bit
yaml text/x-yaml 8bit
xml text/xml 8bit
3gp video/3gpp base64
3g2 video/3gpp2 base64
dv video/DV base64
Expand Down
Loading