Skip to content

Instantly share code, notes, and snippets.

@Thermatix
Last active January 26, 2016 17:33
Show Gist options
  • Save Thermatix/318504f5132a4cc834c6 to your computer and use it in GitHub Desktop.
Save Thermatix/318504f5132a4cc834c6 to your computer and use it in GitHub Desktop.
require 'easy_set'
module Asset_Pipeline
class Mime_Types
include Easy_Set
set ".x3d", "application/vnd.hzn-3d-crossword"
set ".3gp", "video/3gpp"
set ".3g2", "video/3gpp2"
set ".mseq", "application/vnd.mseq"
set ".pwn", "application/vnd.3m.post-it-notes"
set ".plb", "application/vnd.3gpp.pic-bw-large"
set ".psb", "application/vnd.3gpp.pic-bw-small"
set ".pvb", "application/vnd.3gpp.pic-bw-var"
set ".tcap", "application/vnd.3gpp2.tcap"
set ".7z", "application/x-7z-compressed"
set ".abw", "application/x-abiword"
set ".ace", "application/x-ace-compressed"
set ".acc", "application/vnd.americandynamics.acc"
set ".acu", "application/vnd.acucobol"
set ".atc", "application/vnd.acucorp"
set ".adp", "audio/adpcm"
set ".aab", "application/x-authorware-bin"
set ".aam", "application/x-authorware-map"
set ".aas", "application/x-authorware-seg"
set ".air", "application/vnd.adobe.air-application-installer-package+zip"
set ".swf", "application/x-shockwave-flash"
set ".fxp", "application/vnd.adobe.fxp"
set ".pdf", "application/pdf"
set ".ppd", "application/vnd.cups-ppd"
set ".dir", "application/x-director"
set ".xdp", "application/vnd.adobe.xdp+xml"
set ".xfdf", "application/vnd.adobe.xfdf"
set ".aac", "audio/x-aac"
set ".ahead", "application/vnd.ahead.space"
set ".azf", "application/vnd.airzip.filesecure.azf"
set ".azs", "application/vnd.airzip.filesecure.azs"
set ".azw", "application/vnd.amazon.ebook"
set ".ami", "application/vnd.amiga.ami"
set ".apk", "application/vnd.android.package-archive"
set ".cii", "application/vnd.anser-web-certificate-issue-initiation"
set ".fti", "application/vnd.anser-web-funds-transfer-initiation"
set ".atx", "application/vnd.antix.game-component"
set ".mpkg", "application/vnd.apple.installer+xml"
set ".aw", "application/applixware"
set ".les", "application/vnd.hhe.lesson-player"
set ".swi", "application/vnd.aristanetworks.swi"
set ".s", "text/x-asm"
set ".atomcat", "application/atomcat+xml"
set ".atomsvc", "application/atomsvc+xml"
set ".atom,.xml", "application/atom+xml"
set ".ac", "application/pkix-attr-cert"
set ".aif", "audio/x-aiff"
set ".avi", "video/x-msvideo"
set ".aep", "application/vnd.audiograph"
set ".dxf", "image/vnd.dxf"
set ".dwf", "model/vnd.dwf"
set ".par", "text/plain-bas"
set ".bcpio", "application/x-bcpio"
set ".bin", "application/octet-stream"
set ".bmp", "image/bmp"
set ".torrent", "application/x-bittorrent"
set ".cod", "application/vnd.rim.cod"
set ".mpm", "application/vnd.blueice.multipass"
set ".bmi", "application/vnd.bmi"
set ".sh", "application/x-sh"
set ".btif", "image/prs.btif"
set ".rep", "application/vnd.businessobjects"
set ".bz", "application/x-bzip"
set ".bz2", "application/x-bzip2"
set ".csh", "application/x-csh"
set ".c", "text/x-c"
set ".cdxml", "application/vnd.chemdraw+xml"
set ".css", "text/css"
set ".cdx", "chemical/x-cdx"
set ".cml", "chemical/x-cml"
set ".csml", "chemical/x-csml"
set ".cdbcmsg", "application/vnd.contact.cmsg"
set ".cla", "application/vnd.claymore"
set ".c4g", "application/vnd.clonk.c4group"
set ".sub", "image/vnd.dvb.subtitle"
set ".cdmia", "application/cdmi-capability"
set ".cdmic", "application/cdmi-container"
set ".cdmid", "application/cdmi-domain"
set ".cdmio", "application/cdmi-object"
set ".cdmiq", "application/cdmi-queue"
set ".c11amc", "application/vnd.cluetrust.cartomobile-config"
set ".c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"
set ".ras", "image/x-cmu-raster"
set ".dae", "model/vnd.collada+xml"
set ".csv", "text/csv"
set ".cpt", "application/mac-compactpro"
set ".wmlc", "application/vnd.wap.wmlc"
set ".cgm", "image/cgm"
set ".ice", "x-conference/x-cooltalk"
set ".cmx", "image/x-cmx"
set ".xar", "application/vnd.xara"
set ".cmc", "application/vnd.cosmocaller"
set ".cpio", "application/x-cpio"
set ".clkx", "application/vnd.crick.clicker"
set ".clkk", "application/vnd.crick.clicker.keyboard"
set ".clkp", "application/vnd.crick.clicker.palette"
set ".clkt", "application/vnd.crick.clicker.template"
set ".clkw", "application/vnd.crick.clicker.wordbank"
set ".wbs", "application/vnd.criticaltools.wbs+xml"
set ".cryptonote", "application/vnd.rig.cryptonote"
set ".cif", "chemical/x-cif"
set ".cmdf", "chemical/x-cmdf"
set ".cu", "application/cu-seeme"
set ".cww", "application/prs.cww"
set ".curl", "text/vnd.curl"
set ".dcurl", "text/vnd.curl.dcurl"
set ".mcurl", "text/vnd.curl.mcurl"
set ".scurl", "text/vnd.curl.scurl"
set ".car", "application/vnd.curl.car"
set ".pcurl", "application/vnd.curl.pcurl"
set ".cmp", "application/vnd.yellowriver-custom-menu"
set ".dssc", "application/dssc+der"
set ".xdssc", "application/dssc+xml"
set ".deb", "application/x-debian-package"
set ".uva", "audio/vnd.dece.audio"
set ".uvi", "image/vnd.dece.graphic"
set ".uvh", "video/vnd.dece.hd"
set ".uvm", "video/vnd.dece.mobile"
set ".uvu", "video/vnd.uvvu.mp4"
set ".uvp", "video/vnd.dece.pd"
set ".uvs", "video/vnd.dece.sd"
set ".uvv", "video/vnd.dece.video"
set ".dvi", "application/x-dvi"
set ".seed", "application/vnd.fdsn.seed"
set ".dtb", "application/x-dtbook+xml"
set ".res", "application/x-dtbresource+xml"
set ".ait", "application/vnd.dvb.ait"
set ".svc", "application/vnd.dvb.service"
set ".eol", "audio/vnd.digital-winds"
set ".djvu", "image/vnd.djvu"
set ".dtd", "application/xml-dtd"
set ".mlp", "application/vnd.dolby.mlp"
set ".wad", "application/x-doom"
set ".dpg", "application/vnd.dpgraph"
set ".dra", "audio/vnd.dra"
set ".dfac", "application/vnd.dreamfactory"
set ".dts", "audio/vnd.dts"
set ".dtshd", "audio/vnd.dts.hd"
set ".dwg", "image/vnd.dwg"
set ".geo", "application/vnd.dynageo"
set ".es", "application/ecmascript"
set ".mag", "application/vnd.ecowin.chart"
set ".mmr", "image/vnd.fujixerox.edmics-mmr"
set ".rlc", "image/vnd.fujixerox.edmics-rlc"
set ".exi", "application/exi"
set ".mgz", "application/vnd.proteus.magazine"
set ".epub", "application/epub+zip"
set ".eml", "message/rfc822"
set ".nml", "application/vnd.enliven"
set ".xpr", "application/vnd.is-xpr"
set ".xif", "image/vnd.xiff"
set ".xfdl", "application/vnd.xfdl"
set ".emma", "application/emma+xml"
set ".ez2", "application/vnd.ezpix-album"
set ".ez3", "application/vnd.ezpix-package"
set ".fst", "image/vnd.fst"
set ".fvt", "video/vnd.fvt"
set ".fbs", "image/vnd.fastbidsheet"
set ".fe_launch", "application/vnd.denovo.fcselayout-link"
set ".f4v", "video/x-f4v"
set ".flv", "video/x-flv"
set ".fpx", "image/vnd.fpx"
set ".npx", "image/vnd.net-fpx"
set ".flx", "text/vnd.fmi.flexstor"
set ".fli", "video/x-fli"
set ".ftc", "application/vnd.fluxtime.clip"
set ".fdf", "application/vnd.fdf"
set ".f", "text/x-fortran"
set ".mif", "application/vnd.mif"
set ".fm", "application/vnd.framemaker"
set ".fh", "image/x-freehand"
set ".fsc", "application/vnd.fsc.weblaunch"
set ".fnc", "application/vnd.frogans.fnc"
set ".ltf", "application/vnd.frogans.ltf"
set ".ddd", "application/vnd.fujixerox.ddd"
set ".xdw", "application/vnd.fujixerox.docuworks"
set ".xbd", "application/vnd.fujixerox.docuworks.binder"
set ".oas", "application/vnd.fujitsu.oasys"
set ".oa2", "application/vnd.fujitsu.oasys2"
set ".oa3", "application/vnd.fujitsu.oasys3"
set ".fg5", "application/vnd.fujitsu.oasysgp"
set ".bh2", "application/vnd.fujitsu.oasysprs"
set ".spl", "application/x-futuresplash"
set ".fzs", "application/vnd.fuzzysheet"
set ".g3", "image/g3fax"
set ".gmx", "application/vnd.gmx"
set ".gtw", "model/vnd.gtw"
set ".txd", "application/vnd.genomatix.tuxedo"
set ".ggb", "application/vnd.geogebra.file"
set ".ggt", "application/vnd.geogebra.tool"
set ".gdl", "model/vnd.gdl"
set ".gex", "application/vnd.geometry-explorer"
set ".gxt", "application/vnd.geonext"
set ".g2w", "application/vnd.geoplan"
set ".g3w", "application/vnd.geospace"
set ".gsf", "application/x-font-ghostscript"
set ".bdf", "application/x-font-bdf"
set ".gtar", "application/x-gtar"
set ".texinfo", "application/x-texinfo"
set ".gnumeric", "application/x-gnumeric"
set ".kml", "application/vnd.google-earth.kml+xml"
set ".kmz", "application/vnd.google-earth.kmz"
set ".gqf", "application/vnd.grafeq"
set ".gif", "image/gif"
set ".gv", "text/vnd.graphviz"
set ".gac", "application/vnd.groove-account"
set ".ghf", "application/vnd.groove-help"
set ".gim", "application/vnd.groove-identity-message"
set ".grv", "application/vnd.groove-injector"
set ".gtm", "application/vnd.groove-tool-message"
set ".tpl", "application/vnd.groove-tool-template"
set ".vcg", "application/vnd.groove-vcard"
set ".h261", "video/h261"
set ".h263", "video/h263"
set ".h264", "video/h264"
set ".hpid", "application/vnd.hp-hpid"
set ".hps", "application/vnd.hp-hps"
set ".hdf", "application/x-hdf"
set ".rip", "audio/vnd.rip"
set ".hbci", "application/vnd.hbci"
set ".jlt", "application/vnd.hp-jlyt"
set ".pcl", "application/vnd.hp-pcl"
set ".hpgl", "application/vnd.hp-hpgl"
set ".hvs", "application/vnd.yamaha.hv-script"
set ".hvd", "application/vnd.yamaha.hv-dic"
set ".hvp", "application/vnd.yamaha.hv-voice"
set ".sfd-hdstx", "application/vnd.hydrostatix.sof-data"
set ".stk", "application/hyperstudio"
set ".hal", "application/vnd.hal+xml"
set ".html", "text/html"
set ".irm", "application/vnd.ibm.rights-management"
set ".sc", "application/vnd.ibm.secure-container"
set ".ics", "text/calendar"
set ".icc", "application/vnd.iccprofile"
set ".ico", "image/x-icon"
set ".igl", "application/vnd.igloader"
set ".ief", "image/ief"
set ".ivp", "application/vnd.immervision-ivp"
set ".ivu", "application/vnd.immervision-ivu"
set ".rif", "application/reginfo+xml"
set ".3dml", "text/vnd.in3d.3dml"
set ".spot", "text/vnd.in3d.spot"
set ".igs", "model/iges"
set ".i2g", "application/vnd.intergeo"
set ".cdy", "application/vnd.cinderella"
set ".xpw", "application/vnd.intercon.formnet"
set ".fcs", "application/vnd.isac.fcs"
set ".ipfix", "application/ipfix"
set ".cer", "application/pkix-cert"
set ".pki", "application/pkixcmp"
set ".crl", "application/pkix-crl"
set ".pkipath", "application/pkix-pkipath"
set ".igm", "application/vnd.insors.igm"
set ".rcprofile", "application/vnd.ipunplugged.rcprofile"
set ".irp", "application/vnd.irepository.package+xml"
set ".jad", "text/vnd.sun.j2me.app-descriptor"
set ".jar", "application/java-archive"
set ".class", "application/java-vm"
set ".jnlp", "application/x-java-jnlp-file"
set ".ser", "application/java-serialized-object"
set ".java", "text/x-java-source,java"
set ".js", "application/javascript"
set ".json", "application/json"
set ".joda", "application/vnd.joost.joda-archive"
set ".jpm", "video/jpm"
set ".jpeg", "image/jpeg"
set ".jpg", "image/jpeg"
set ".jpgv", "video/jpeg"
set ".ktz", "application/vnd.kahootz"
set ".mmd", "application/vnd.chipnuts.karaoke-mmd"
set ".karbon", "application/vnd.kde.karbon"
set ".chrt", "application/vnd.kde.kchart"
set ".kfo", "application/vnd.kde.kformula"
set ".flw", "application/vnd.kde.kivio"
set ".kon", "application/vnd.kde.kontour"
set ".kpr", "application/vnd.kde.kpresenter"
set ".ksp", "application/vnd.kde.kspread"
set ".kwd", "application/vnd.kde.kword"
set ".htke", "application/vnd.kenameaapp"
set ".kia", "application/vnd.kidspiration"
set ".kne", "application/vnd.kinar"
set ".sse", "application/vnd.kodak-descriptor"
set ".lasxml", "application/vnd.las.las+xml"
set ".latex", "application/x-latex"
set ".lbd", "application/vnd.llamagraphics.life-balance.desktop"
set ".lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"
set ".jam", "application/vnd.jam"
set ".123", "application/vnd.lotus-1-2-3"
set ".apr", "application/vnd.lotus-approach"
set ".pre", "application/vnd.lotus-freelance"
set ".nsf", "application/vnd.lotus-notes"
set ".org", "application/vnd.lotus-organizer"
set ".scm", "application/vnd.lotus-screencam"
set ".lwp", "application/vnd.lotus-wordpro"
set ".lvp", "audio/vnd.lucent.voice"
set ".m3u", "audio/x-mpegurl"
set ".m4v", "video/x-m4v"
set ".hqx", "application/mac-binhex40"
set ".portpkg", "application/vnd.macports.portpkg"
set ".mgp", "application/vnd.osgeo.mapguide.package"
set ".mrc", "application/marc"
set ".mrcx", "application/marcxml+xml"
set ".mxf", "application/mxf"
set ".nbp", "application/vnd.wolfram.player"
set ".ma", "application/mathematica"
set ".mathml", "application/mathml+xml"
set ".mbox", "application/mbox"
set ".mc1", "application/vnd.medcalcdata"
set ".mscml", "application/mediaservercontrol+xml"
set ".cdkey", "application/vnd.mediastation.cdkey"
set ".mwf", "application/vnd.mfer"
set ".mfm", "application/vnd.mfmp"
set ".msh", "model/mesh"
set ".mads", "application/mads+xml"
set ".mets", "application/mets+xml"
set ".mods", "application/mods+xml"
set ".meta4", "application/metalink4+xml"
set ".potm", "application/vnd.ms-powerpoint.template.macroenabled.12"
set ".docm", "application/vnd.ms-word.document.macroenabled.12"
set ".dotm", "application/vnd.ms-word.template.macroenabled.12"
set ".mcd", "application/vnd.mcd"
set ".flo", "application/vnd.micrografx.flo"
set ".igx", "application/vnd.micrografx.igx"
set ".es3", "application/vnd.eszigno3+xml"
set ".mdb", "application/x-msaccess"
set ".asf", "video/x-ms-asf"
set ".exe", "application/x-msdownload"
set ".cil", "application/vnd.ms-artgalry"
set ".cab", "application/vnd.ms-cab-compressed"
set ".ims", "application/vnd.ms-ims"
set ".application", "application/x-ms-application"
set ".clp", "application/x-msclip"
set ".mdi", "image/vnd.ms-modi"
set ".eot", "application/vnd.ms-fontobject"
set ".xls", "application/vnd.ms-excel"
set ".xlam", "application/vnd.ms-excel.addin.macroenabled.12"
set ".xlsb", "application/vnd.ms-excel.sheet.binary.macroenabled.12"
set ".xltm", "application/vnd.ms-excel.template.macroenabled.12"
set ".xlsm", "application/vnd.ms-excel.sheet.macroenabled.12"
set ".chm", "application/vnd.ms-htmlhelp"
set ".crd", "application/x-mscardfile"
set ".lrm", "application/vnd.ms-lrm"
set ".mvb", "application/x-msmediaview"
set ".mny", "application/x-msmoney"
set ".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"
set ".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"
set ".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"
set ".potx", "application/vnd.openxmlformats-officedocument.presentationml.template"
set ".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
set ".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"
set ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
set ".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"
set ".obd", "application/x-msbinder"
set ".thmx", "application/vnd.ms-officetheme"
set ".onetoc", "application/onenote"
set ".pya", "audio/vnd.ms-playready.media.pya"
set ".pyv", "video/vnd.ms-playready.media.pyv"
set ".ppt", "application/vnd.ms-powerpoint"
set ".ppam", "application/vnd.ms-powerpoint.addin.macroenabled.12"
set ".sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12"
set ".pptm", "application/vnd.ms-powerpoint.presentation.macroenabled.12"
set ".ppsm", "application/vnd.ms-powerpoint.slideshow.macroenabled.12"
set ".mpp", "application/vnd.ms-project"
set ".pub", "application/x-mspublisher"
set ".scd", "application/x-msschedule"
set ".xap", "application/x-silverlight-app"
set ".stl", "application/vnd.ms-pki.stl"
set ".cat", "application/vnd.ms-pki.seccat"
set ".vsd", "application/vnd.visio"
set ".wm", "video/x-ms-wm"
set ".wma", "audio/x-ms-wma"
set ".wax", "audio/x-ms-wax"
set ".wmx", "video/x-ms-wmx"
set ".wmd", "application/x-ms-wmd"
set ".wpl", "application/vnd.ms-wpl"
set ".wmz", "application/x-ms-wmz"
set ".wmv", "video/x-ms-wmv"
set ".wvx", "video/x-ms-wvx"
set ".wmf", "application/x-msmetafile"
set ".trm", "application/x-msterminal"
set ".doc", "application/msword"
set ".wri", "application/x-mswrite"
set ".wps", "application/vnd.ms-works"
set ".xbap", "application/x-ms-xbap"
set ".xps", "application/vnd.ms-xpsdocument"
set ".mid", "audio/midi"
set ".mpy", "application/vnd.ibm.minipay"
set ".afp", "application/vnd.ibm.modcap"
set ".rms", "application/vnd.jcp.javame.midlet-rms"
set ".tmo", "application/vnd.tmobile-livetv"
set ".prc", "application/x-mobipocket-ebook"
set ".mbk", "application/vnd.mobius.mbk"
set ".dis", "application/vnd.mobius.dis"
set ".plc", "application/vnd.mobius.plc"
set ".mqy", "application/vnd.mobius.mqy"
set ".msl", "application/vnd.mobius.msl"
set ".txf", "application/vnd.mobius.txf"
set ".daf", "application/vnd.mobius.daf"
set ".fly", "text/vnd.fly"
set ".mpc", "application/vnd.mophun.certificate"
set ".mpn", "application/vnd.mophun.application"
set ".mj2", "video/mj2"
set ".mpga", "audio/mpeg"
set ".mxu", "video/vnd.mpegurl"
set ".mpeg", "video/mpeg"
set ".m21", "application/mp21"
set ".mp4a", "audio/mp4"
set ".mp4", "video/mp4"
set ".mp4", "application/mp4"
set ".m3u8", "application/vnd.apple.mpegurl"
set ".mus", "application/vnd.musician"
set ".msty", "application/vnd.muvee.style"
set ".mxml", "application/xv+xml"
set ".ngdat", "application/vnd.nokia.n-gage.data"
set ".n-gage", "application/vnd.nokia.n-gage.symbian.install"
set ".ncx", "application/x-dtbncx+xml"
set ".nc", "application/x-netcdf"
set ".nlu", "application/vnd.neurolanguage.nlu"
set ".dna", "application/vnd.dna"
set ".nnd", "application/vnd.noblenet-directory"
set ".nns", "application/vnd.noblenet-sealer"
set ".nnw", "application/vnd.noblenet-web"
set ".rpst", "application/vnd.nokia.radio-preset"
set ".rpss", "application/vnd.nokia.radio-presets"
set ".n3", "text/n3"
set ".edm", "application/vnd.novadigm.edm"
set ".edx", "application/vnd.novadigm.edx"
set ".ext", "application/vnd.novadigm.ext"
set ".gph", "application/vnd.flographit"
set ".ecelp4800", "audio/vnd.nuera.ecelp4800"
set ".ecelp7470", "audio/vnd.nuera.ecelp7470"
set ".ecelp9600", "audio/vnd.nuera.ecelp9600"
set ".oda", "application/oda"
set ".ogx", "application/ogg"
set ".oga", "audio/ogg"
set ".ogv", "video/ogg"
set ".dd2", "application/vnd.oma.dd2+xml"
set ".oth", "application/vnd.oasis.opendocument.text-web"
set ".opf", "application/oebps-package+xml"
set ".qbo", "application/vnd.intu.qbo"
set ".oxt", "application/vnd.openofficeorg.extension"
set ".osf", "application/vnd.yamaha.openscoreformat"
set ".weba", "audio/webm"
set ".webm", "video/webm"
set ".odc", "application/vnd.oasis.opendocument.chart"
set ".otc", "application/vnd.oasis.opendocument.chart-template"
set ".odb", "application/vnd.oasis.opendocument.database"
set ".odf", "application/vnd.oasis.opendocument.formula"
set ".odft", "application/vnd.oasis.opendocument.formula-template"
set ".odg", "application/vnd.oasis.opendocument.graphics"
set ".otg", "application/vnd.oasis.opendocument.graphics-template"
set ".odi", "application/vnd.oasis.opendocument.image"
set ".oti", "application/vnd.oasis.opendocument.image-template"
set ".odp", "application/vnd.oasis.opendocument.presentation"
set ".otp", "application/vnd.oasis.opendocument.presentation-template"
set ".ods", "application/vnd.oasis.opendocument.spreadsheet"
set ".ots", "application/vnd.oasis.opendocument.spreadsheet-template"
set ".odt", "application/vnd.oasis.opendocument.text"
set ".odm", "application/vnd.oasis.opendocument.text-master"
set ".ott", "application/vnd.oasis.opendocument.text-template"
set ".ktx", "image/ktx"
set ".sxc", "application/vnd.sun.xml.calc"
set ".stc", "application/vnd.sun.xml.calc.template"
set ".sxd", "application/vnd.sun.xml.draw"
set ".std", "application/vnd.sun.xml.draw.template"
set ".sxi", "application/vnd.sun.xml.impress"
set ".sti", "application/vnd.sun.xml.impress.template"
set ".sxm", "application/vnd.sun.xml.math"
set ".sxw", "application/vnd.sun.xml.writer"
set ".sxg", "application/vnd.sun.xml.writer.global"
set ".stw", "application/vnd.sun.xml.writer.template"
set ".otf", "application/x-font-otf"
set ".osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml"
set ".dp", "application/vnd.osgi.dp"
set ".pdb", "application/vnd.palm"
set ".p", "text/x-pascal"
set ".paw", "application/vnd.pawaafile"
set ".pclxl", "application/vnd.hp-pclxl"
set ".efif", "application/vnd.picsel"
set ".pcx", "image/x-pcx"
set ".psd", "image/vnd.adobe.photoshop"
set ".prf", "application/pics-rules"
set ".pic", "image/x-pict"
set ".chat", "application/x-chat"
set ".p10", "application/pkcs10"
set ".p12", "application/x-pkcs12"
set ".p7m", "application/pkcs7-mime"
set ".p7s", "application/pkcs7-signature"
set ".p7r", "application/x-pkcs7-certreqresp"
set ".p7b", "application/x-pkcs7-certificates"
set ".p8", "application/pkcs8"
set ".plf", "application/vnd.pocketlearn"
set ".pnm", "image/x-portable-anymap"
set ".pbm", "image/x-portable-bitmap"
set ".pcf", "application/x-font-pcf"
set ".pfr", "application/font-tdpfr"
set ".pgn", "application/x-chess-pgn"
set ".pgm", "image/x-portable-graymap"
set ".png", "image/png"
set ".ppm", "image/x-portable-pixmap"
set ".pskcxml", "application/pskc+xml"
set ".pml", "application/vnd.ctc-posml"
set ".ai", "application/postscript"
set ".pfa", "application/x-font-type1"
set ".pbd", "application/vnd.powerbuilder6"
set ".pgp", "application/pgp-signature"
set ".box", "application/vnd.previewsystems.box"
set ".ptid", "application/vnd.pvi.ptid1"
set ".pls", "application/pls+xml"
set ".str", "application/vnd.pg.format"
set ".ei6", "application/vnd.pg.osasli"
set ".dsc", "text/prs.lines.tag"
set ".psf", "application/x-font-linux-psf"
set ".qps", "application/vnd.publishare-delta-tree"
set ".wg", "application/vnd.pmi.widget"
set ".qxd", "application/vnd.quark.quarkxpress"
set ".esf", "application/vnd.epson.esf"
set ".msf", "application/vnd.epson.msf"
set ".ssf", "application/vnd.epson.ssf"
set ".qam", "application/vnd.epson.quickanime"
set ".qfx", "application/vnd.intu.qfx"
set ".qt", "video/quicktime"
set ".rar", "application/x-rar-compressed"
set ".ram", "audio/x-pn-realaudio"
set ".rmp", "audio/x-pn-realaudio-plugin"
set ".rsd", "application/rsd+xml"
set ".rm", "application/vnd.rn-realmedia"
set ".bed", "application/vnd.realvnc.bed"
set ".mxl", "application/vnd.recordare.musicxml"
set ".musicxml", "application/vnd.recordare.musicxml+xml"
set ".rnc", "application/relax-ng-compact-syntax"
set ".rdz", "application/vnd.data-vision.rdz"
set ".rdf", "application/rdf+xml"
set ".rp9", "application/vnd.cloanto.rp9"
set ".jisp", "application/vnd.jisp"
set ".rtf", "application/rtf"
set ".rtx", "text/richtext"
set ".link66", "application/vnd.route66.link66+xml"
set ".rss,.xml", "application/rss+xml"
set ".shf", "application/shf+xml"
set ".st", "application/vnd.sailingtracker.track"
set ".svg", "image/svg+xml"
set ".sus", "application/vnd.sus-calendar"
set ".sru", "application/sru+xml"
set ".setpay", "application/set-payment-initiation"
set ".setreg", "application/set-registration-initiation"
set ".sema", "application/vnd.sema"
set ".semd", "application/vnd.semd"
set ".semf", "application/vnd.semf"
set ".see", "application/vnd.seemail"
set ".snf", "application/x-font-snf"
set ".spq", "application/scvp-vp-request"
set ".spp", "application/scvp-vp-response"
set ".scq", "application/scvp-cv-request"
set ".scs", "application/scvp-cv-response"
set ".sdp", "application/sdp"
set ".etx", "text/x-setext"
set ".movie", "video/x-sgi-movie"
set ".ifm", "application/vnd.shana.informed.formdata"
set ".itp", "application/vnd.shana.informed.formtemplate"
set ".iif", "application/vnd.shana.informed.interchange"
set ".ipk", "application/vnd.shana.informed.package"
set ".tfi", "application/thraud+xml"
set ".shar", "application/x-shar"
set ".rgb", "image/x-rgb"
set ".slt", "application/vnd.epson.salt"
set ".aso", "application/vnd.accpac.simply.aso"
set ".imp", "application/vnd.accpac.simply.imp"
set ".twd", "application/vnd.simtech-mindmapper"
set ".csp", "application/vnd.commonspace"
set ".saf", "application/vnd.yamaha.smaf-audio"
set ".mmf", "application/vnd.smaf"
set ".spf", "application/vnd.yamaha.smaf-phrase"
set ".teacher", "application/vnd.smart.teacher"
set ".svd", "application/vnd.svd"
set ".rq", "application/sparql-query"
set ".srx", "application/sparql-results+xml"
set ".gram", "application/srgs"
set ".grxml", "application/srgs+xml"
set ".ssml", "application/ssml+xml"
set ".skp", "application/vnd.koan"
set ".sgml", "text/sgml"
set ".sdc", "application/vnd.stardivision.calc"
set ".sda", "application/vnd.stardivision.draw"
set ".sdd", "application/vnd.stardivision.impress"
set ".smf", "application/vnd.stardivision.math"
set ".sdw", "application/vnd.stardivision.writer"
set ".sgl", "application/vnd.stardivision.writer-global"
set ".sm", "application/vnd.stepmania.stepchart"
set ".sit", "application/x-stuffit"
set ".sitx", "application/x-stuffitx"
set ".sdkm", "application/vnd.solent.sdkm+xml"
set ".xo", "application/vnd.olpc-sugar"
set ".au", "audio/basic"
set ".wqd", "application/vnd.wqd"
set ".sis", "application/vnd.symbian.install"
set ".smi", "application/smil+xml"
set ".xsm", "application/vnd.syncml+xml"
set ".bdm", "application/vnd.syncml.dm+wbxml"
set ".xdm", "application/vnd.syncml.dm+xml"
set ".sv4cpio", "application/x-sv4cpio"
set ".sv4crc", "application/x-sv4crc"
set ".sbml", "application/sbml+xml"
set ".tsv", "text/tab-separated-values"
set ".tiff", "image/tiff"
set ".tao", "application/vnd.tao.intent-module-archive"
set ".tar", "application/x-tar"
set ".tcl", "application/x-tcl"
set ".tex", "application/x-tex"
set ".tfm", "application/x-tex-tfm"
set ".tei", "application/tei+xml"
set ".txt", "text/plain"
set ".dxp", "application/vnd.spotfire.dxp"
set ".sfs", "application/vnd.spotfire.sfs"
set ".tsd", "application/timestamped-data"
set ".tpt", "application/vnd.trid.tpt"
set ".mxs", "application/vnd.triscape.mxs"
set ".t", "text/troff"
set ".tra", "application/vnd.trueapp"
set ".ttf", "application/x-font-ttf"
set ".ttl", "text/turtle"
set ".umj", "application/vnd.umajin"
set ".uoml", "application/vnd.uoml+xml"
set ".unityweb", "application/vnd.unity"
set ".ufd", "application/vnd.ufdl"
set ".uri", "text/uri-list"
set ".utz", "application/vnd.uiq.theme"
set ".ustar", "application/x-ustar"
set ".uu", "text/x-uuencode"
set ".vcs", "text/x-vcalendar"
set ".vcf", "text/x-vcard"
set ".vcd", "application/x-cdlink"
set ".vsf", "application/vnd.vsf"
set ".wrl", "model/vrml"
set ".vcx", "application/vnd.vcx"
set ".mts", "model/vnd.mts"
set ".vtu", "model/vnd.vtu"
set ".vis", "application/vnd.visionary"
set ".viv", "video/vnd.vivo"
set ".ccxml", "application/ccxml+xml,"
set ".vxml", "application/voicexml+xml"
set ".src", "application/x-wais-source"
set ".wbxml", "application/vnd.wap.wbxml"
set ".wbmp", "image/vnd.wap.wbmp"
set ".wav", "audio/x-wav"
set ".davmount", "application/davmount+xml"
set ".woff", "application/x-font-woff"
set ".wspolicy", "application/wspolicy+xml"
set ".webp", "image/webp"
set ".wtb", "application/vnd.webturbo"
set ".wgt", "application/widget"
set ".hlp", "application/winhlp"
set ".wml", "text/vnd.wap.wml"
set ".wmls", "text/vnd.wap.wmlscript"
set ".wmlsc", "application/vnd.wap.wmlscriptc"
set ".wpd", "application/vnd.wordperfect"
set ".stf", "application/vnd.wt.stf"
set ".wsdl", "application/wsdl+xml"
set ".xbm", "image/x-xbitmap"
set ".xpm", "image/x-xpixmap"
set ".xwd", "image/x-xwindowdump"
set ".der", "application/x-x509-ca-cert"
set ".fig", "application/x-xfig"
set ".xhtml", "application/xhtml+xml"
set ".xml", "application/xml"
set ".xdf", "application/xcap-diff+xml"
set ".xenc", "application/xenc+xml"
set ".xer", "application/patch-ops-error+xml"
set ".rl", "application/resource-lists+xml"
set ".rs", "application/rls-services+xml"
set ".rld", "application/resource-lists-diff+xml"
set ".xslt", "application/xslt+xml"
set ".xop", "application/xop+xml"
set ".xpi", "application/x-xpinstall"
set ".xspf", "application/xspf+xml"
set ".xul", "application/vnd.mozilla.xul+xml"
set ".xyz", "chemical/x-xyz"
set ".yaml", "text/yaml"
set ".yang", "application/yang"
set ".yin", "application/yin+xml"
set ".zir", "application/vnd.zul"
set ".zip", "application/zip"
set ".zmm", "application/vnd.handheld-entertainment+xml"
set ".zaz", "application/vnd.zzazz.deck+xml"
end
end
require 'asset_mime_types'
module Asset_Pipeline
Opal = ::Opal
Sprockets = ::Sprockets
class << self
attr_reader :get_asset
def defaults
{
root: Dir.pwd,
prefix: 'assets',
asset_folders: %w{js css font images},
public_path: -> {"#{settings.root}/public"},
asset_folder: -> {"#{settings.root}/#{settings.prefix}" },
digest: false,
opal_libs: [],
assets: -> {
Sprockets::Environment.new do |env|
#register opal with sprockets
# env.register_engine '.opal', Opal::Processor
#require opal libraries to load path
settings.opal_libs.each do |lib|
require lib
end
Opal.paths.each {|p|env.append_path p}
settings.asset_folders.each do |folder|
env.append_path "#{settings.asset_folder}/#{folder}"
end
#set up asset root folder
env.append_path settings.asset_folder
#set up compressers and pre-proccessors
env.js_compressor = YUI::JavaScriptCompressor.new unless ENV['RACK_ENV'] != 'production'
env.css_compressor = :sass
end
}
}
end
def find_css_path asset_folders
%w{css stylesheets}.each do |folder|
break folder if asset_folders.include? folder
end
end
end
@get_asset = Proc.new do |file_name,extention|
content_type Mime_Types[extention]
settings.assets["#{file_name}#{extention}"]
end
def self.included base
base.class_exec(self) do |assets|
#configure opal
Opal::Config.config.each do |c_option,default|
if settings.respond_to? c_option
c = "#{c_option}="
Opal::Config.send(c,settings.send(c_option))
end
end
# method_missing_enabled: true,
#arity_check_enabled: false,
#const_missing_enabled: true,
#dynamic_require_severity: :error, # :error, :warning or :ignore
#irb_enabled: false,
#inline_operators_enabled: true,
#source_map_enabled: true,
configure do
Tilt.register Tilt::ERBTemplate, 'html.erb'
assets.defaults.each do |key,to_value|
unless settings.respond_to? key
set key, ( to_value.respond_to?(:call) ? self.instance_exec(&to_value) : to_value)
end
end
Sprockets::Helpers.configure do |config|
config.prefix = settings.prefix
config.digest = settings.digest
config.public_path = settings.public_path
config.environment = settings.assets
config.debug = true unless ENV['RACK_ENV'] == 'production'
end
::Sass.load_paths << "#{settings.asset_folder}/" + assets.find_css_path(self.asset_folders)
end
if ENV['RACK_ENV'] == 'production'
Opal::Config.source_map_enabled = false
else
Opal::Config.source_map_enabled = false
end
##add asset routes for prefix folder
get %r{/#{settings.prefix}/(.*|(?:.*/.*))(\W.*)$} do
self.instance_exec(*params[:captures],&assets.get_asset)
end
#add asset types
settings.asset_folders.each do |asset_type|
get %r{/#{settings.prefix}/#{asset_type}/(.*|(?:.*/.*))(\W.*)$} do
self.instance_exec(*params[:captures],&assets.get_asset)
end
end
helpers Sprockets::Helpers
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment