From 67ed060d378f7e39992c0f520bbb4a408f2f5f81 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 16:33:12 -0700 Subject: [PATCH] Assert CodeMirror modes and mime types are valid against source --- lib/linguist/language.rb | 6 +- lib/linguist/languages.yml | 368 ++++++++++++++++++------------------- test/test_grammars.rb | 2 +- test/test_language.rb | 22 +-- 4 files changed, 199 insertions(+), 199 deletions(-) diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index e4d3cf71..875ef956 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -302,7 +302,7 @@ module Linguist @ace_mode = attributes[:ace_mode] @codemirror_mode = attributes[:codemirror_mode] - @codemirror_mime_mode = attributes[:codemirror_mime_mode] + @codemirror_mime_type = attributes[:codemirror_mime_type] @wrap = attributes[:wrap] || false # Set legacy search term @@ -423,7 +423,7 @@ module Linguist # # => "text/x-csrc" # # Returns a String name or nil - attr_reader :codemirror_mime_mode + attr_reader :codemirror_mime_type # Public: Should language lines be wrapped # @@ -602,7 +602,7 @@ module Linguist :tm_scope => options['tm_scope'], :ace_mode => options['ace_mode'], :codemirror_mode => options['codemirror_mode'], - :codemirror_mime_mode => options['codemirror_mime_mode'], + :codemirror_mime_type => options['codemirror_mime_type'], :wrap => options['wrap'], :group_name => options['group'], :searchable => options.fetch('searchable', true), diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 9bb32f8a..269525ce 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -60,7 +60,7 @@ AGS Script: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 2 AMPL: type: programming @@ -99,7 +99,7 @@ APL: tm_scope: source.apl ace_mode: text codemirror_mode: apl - codemirror_mime_mode: text/apl + codemirror_mime_type: text/apl language_id: 6 ASN.1: type: data @@ -110,7 +110,7 @@ ASN.1: tm_scope: source.asn ace_mode: text codemirror_mode: asn.1 - codemirror_mime_mode: text/x-ttcn-asn + codemirror_mime_type: text/x-ttcn-asn language_id: 7 ASP: type: programming @@ -130,7 +130,7 @@ ASP: - ".axd" ace_mode: text codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-aspx + codemirror_mime_type: application/x-aspx language_id: 8 ATS: type: programming @@ -194,7 +194,7 @@ Alpine Abuild: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 14 Ant Build System: type: data @@ -204,7 +204,7 @@ Ant Build System: - build.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: application/xml + codemirror_mime_type: application/xml language_id: 15 ApacheConf: type: markup @@ -224,7 +224,7 @@ Apex: tm_scope: source.java ace_mode: java codemirror_mode: clike - codemirror_mime_mode: text/x-java + codemirror_mime_type: text/x-java language_id: 17 Apollo Guidance Computer: type: programming @@ -263,7 +263,7 @@ Arduino: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 21 AsciiDoc: type: prose @@ -434,7 +434,7 @@ Brainfuck: tm_scope: source.bf ace_mode: text codemirror_mode: brainfuck - codemirror_mime_mode: text/x-brainfuck + codemirror_mime_type: text/x-brainfuck language_id: 38 Brightscript: type: programming @@ -462,13 +462,13 @@ C: - tcc ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 41 C#: type: programming ace_mode: csharp codemirror_mode: clike - codemirror_mime_mode: text/x-csharp + codemirror_mime_type: text/x-csharp tm_scope: source.cs search_term: csharp color: "#178600" @@ -484,7 +484,7 @@ C++: type: programming ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src search_term: cpp color: "#f34b7d" aliases: @@ -523,7 +523,7 @@ C2hs Haskell: tm_scope: source.haskell ace_mode: haskell codemirror_mode: haskell - codemirror_mime_mode: text/x-haskell + codemirror_mime_type: text/x-haskell language_id: 45 CLIPS: type: programming @@ -541,7 +541,7 @@ CMake: - CMakeLists.txt ace_mode: text codemirror_mode: cmake - codemirror_mime_mode: text/x-cmake + codemirror_mime_type: text/x-cmake language_id: 47 COBOL: type: programming @@ -553,7 +553,7 @@ COBOL: - ".cpy" ace_mode: cobol codemirror_mode: cobol - codemirror_mime_mode: text/x-cobol + codemirror_mime_type: text/x-cobol language_id: 48 COLLADA: type: data @@ -562,14 +562,14 @@ COLLADA: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 49 CSS: type: markup tm_scope: source.css ace_mode: css codemirror_mode: css - codemirror_mime_mode: text/css + codemirror_mime_type: text/css color: "#563d7c" extensions: - ".css" @@ -626,7 +626,7 @@ ChucK: tm_scope: source.java ace_mode: java codemirror_mode: clike - codemirror_mime_mode: text/x-java + codemirror_mime_type: text/x-java language_id: 57 Cirru: type: programming @@ -664,7 +664,7 @@ Clojure: type: programming ace_mode: clojure codemirror_mode: clojure - codemirror_mime_mode: text/x-clojure + codemirror_mime_type: text/x-clojure color: "#db5855" extensions: - ".clj" @@ -684,7 +684,7 @@ CoffeeScript: tm_scope: source.coffee ace_mode: coffee codemirror_mode: coffeescript - codemirror_mime_mode: text/x-coffeescript + codemirror_mime_type: text/x-coffeescript color: "#244776" aliases: - coffee @@ -751,7 +751,7 @@ Common Lisp: - ecl ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 66 Component Pascal: type: programming @@ -765,7 +765,7 @@ Component Pascal: - objectpascal ace_mode: pascal codemirror_mode: pascal - codemirror_mime_mode: text/x-pascal + codemirror_mime_type: text/x-pascal language_id: 67 Cool: type: programming @@ -809,7 +809,7 @@ Crystal: - ".cr" ace_mode: ruby codemirror_mode: crystal - codemirror_mime_mode: text/x-crystal + codemirror_mime_type: text/x-crystal tm_scope: source.crystal interpreters: - crystal @@ -860,7 +860,7 @@ Cuda: tm_scope: source.cuda-c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src color: "#3A4E3A" language_id: 77 Cycript: @@ -870,7 +870,7 @@ Cycript: tm_scope: source.js ace_mode: javascript codemirror_mode: javascript - codemirror_mime_mode: text/javascript + codemirror_mime_type: text/javascript language_id: 78 Cython: type: programming @@ -883,7 +883,7 @@ Cython: - pyrex ace_mode: text codemirror_mode: python - codemirror_mime_mode: text/x-cython + codemirror_mime_type: text/x-cython language_id: 79 D: type: programming @@ -893,7 +893,7 @@ D: - ".di" ace_mode: d codemirror_mode: d - codemirror_mime_mode: text/x-d + codemirror_mime_type: text/x-d language_id: 80 D-ObjDump: type: data @@ -940,7 +940,7 @@ DTrace: tm_scope: source.c ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 85 Darcs Patch: type: data @@ -962,7 +962,7 @@ Dart: - dart ace_mode: dart codemirror_mode: dart - codemirror_mime_mode: application/dart + codemirror_mime_type: application/dart language_id: 87 Diff: type: data @@ -974,7 +974,7 @@ Diff: tm_scope: source.diff ace_mode: diff codemirror_mode: diff - codemirror_mime_mode: text/x-diff + codemirror_mime_type: text/x-diff language_id: 88 Dockerfile: type: data @@ -985,7 +985,7 @@ Dockerfile: - Dockerfile ace_mode: dockerfile codemirror_mode: dockerfile - codemirror_mime_mode: text/x-dockerfile + codemirror_mime_type: text/x-dockerfile language_id: 89 Dogescript: type: programming @@ -1005,7 +1005,7 @@ Dylan: - ".lid" ace_mode: text codemirror_mode: dylan - codemirror_mime_mode: text/x-dylan + codemirror_mime_type: text/x-dylan language_id: 91 E: type: programming @@ -1026,7 +1026,7 @@ ECL: tm_scope: none ace_mode: text codemirror_mode: ecl - codemirror_mime_mode: text/x-ecl + codemirror_mime_type: text/x-ecl language_id: 93 ECLiPSe: type: programming @@ -1053,7 +1053,7 @@ EQ: tm_scope: source.cs ace_mode: csharp codemirror_mode: clike - codemirror_mime_mode: text/x-csharp + codemirror_mime_type: text/x-csharp language_id: 96 Eagle: type: markup @@ -1064,7 +1064,7 @@ Eagle: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 97 Ecere Projects: type: data @@ -1074,7 +1074,7 @@ Ecere Projects: tm_scope: source.json ace_mode: json codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json language_id: 98 Eiffel: type: programming @@ -1083,7 +1083,7 @@ Eiffel: - ".e" ace_mode: eiffel codemirror_mode: eiffel - codemirror_mime_mode: text/x-eiffel + codemirror_mime_type: text/x-eiffel language_id: 99 Elixir: type: programming @@ -1105,7 +1105,7 @@ Elm: tm_scope: source.elm ace_mode: elm codemirror_mode: elm - codemirror_mime_mode: text/x-elm + codemirror_mime_type: text/x-elm language_id: 101 Emacs Lisp: type: programming @@ -1130,7 +1130,7 @@ Emacs Lisp: - ".emacs.desktop" ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 102 EmberScript: type: programming @@ -1141,7 +1141,7 @@ EmberScript: tm_scope: source.coffee ace_mode: coffee codemirror_mode: coffeescript - codemirror_mime_mode: text/x-coffeescript + codemirror_mime_type: text/x-coffeescript language_id: 103 Erlang: type: programming @@ -1160,7 +1160,7 @@ Erlang: - rebar.lock ace_mode: erlang codemirror_mode: erlang - codemirror_mime_mode: text/x-erlang + codemirror_mime_type: text/x-erlang interpreters: - escript language_id: 104 @@ -1177,7 +1177,7 @@ F#: tm_scope: source.fsharp ace_mode: text codemirror_mode: mllike - codemirror_mime_mode: text/x-fsharp + codemirror_mime_type: text/x-fsharp language_id: 105 FLUX: type: programming @@ -1203,7 +1203,7 @@ FORTRAN: tm_scope: source.fortran.modern ace_mode: text codemirror_mode: fortran - codemirror_mime_mode: text/x-fortran + codemirror_mime_type: text/x-fortran language_id: 107 Factor: type: programming @@ -1215,7 +1215,7 @@ Factor: - ".factor-rc" ace_mode: text codemirror_mode: factor - codemirror_mime_mode: text/x-factor + codemirror_mime_type: text/x-factor language_id: 108 Fancy: type: programming @@ -1272,7 +1272,7 @@ Forth: - ".fs" ace_mode: forth codemirror_mode: forth - codemirror_mime_mode: text/x-forth + codemirror_mime_type: text/x-forth language_id: 114 FreeMarker: type: programming @@ -1335,7 +1335,7 @@ GCC Machine Description: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 121 GDB: type: programming @@ -1381,7 +1381,7 @@ Game Maker Language: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 125 Genshi: type: programming @@ -1393,7 +1393,7 @@ Genshi: - xml+kid ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 126 Gentoo Ebuild: type: programming @@ -1403,7 +1403,7 @@ Gentoo Ebuild: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 127 Gentoo Eclass: type: programming @@ -1413,7 +1413,7 @@ Gentoo Eclass: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 128 Gettext Catalog: type: prose @@ -1435,7 +1435,7 @@ Glyph: tm_scope: source.tcl ace_mode: tcl codemirror_mode: tcl - codemirror_mime_mode: text/x-tcl + codemirror_mime_type: text/x-tcl language_id: 130 Gnuplot: type: programming @@ -1457,7 +1457,7 @@ Go: - ".go" ace_mode: golang codemirror_mode: go - codemirror_mime_mode: text/x-go + codemirror_mime_type: text/x-go language_id: 132 Golo: type: programming @@ -1504,7 +1504,7 @@ Grammatical Framework: tm_scope: source.haskell ace_mode: haskell codemirror_mode: haskell - codemirror_mime_mode: text/x-haskell + codemirror_mime_type: text/x-haskell language_id: 137 Graph Modeling Language: type: data @@ -1565,13 +1565,13 @@ Groff: - troff ace_mode: text codemirror_mode: troff - codemirror_mime_mode: text/troff + codemirror_mime_type: text/troff language_id: 141 Groovy: type: programming ace_mode: groovy codemirror_mode: groovy - codemirror_mime_mode: text/x-groovy + codemirror_mime_type: text/x-groovy color: "#e69f56" extensions: - ".groovy" @@ -1594,7 +1594,7 @@ Groovy Server Pages: tm_scope: text.html.jsp ace_mode: jsp codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-jsp + codemirror_mime_type: application/x-jsp language_id: 143 HCL: type: programming @@ -1603,7 +1603,7 @@ HCL: - ".tf" ace_mode: ruby codemirror_mode: ruby - codemirror_mime_mode: text/x-ruby + codemirror_mime_type: text/x-ruby tm_scope: source.ruby language_id: 144 HLSL: @@ -1621,7 +1621,7 @@ HTML: tm_scope: text.html.basic ace_mode: html codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html color: "#e44b23" aliases: - xhtml @@ -1648,7 +1648,7 @@ HTML+Django: - htmldjango ace_mode: django codemirror_mode: django - codemirror_mime_mode: text/x-django + codemirror_mime_type: text/x-django language_id: 147 HTML+ECR: type: markup @@ -1660,7 +1660,7 @@ HTML+ECR: - ".ecr" ace_mode: text codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html language_id: 148 HTML+EEX: type: markup @@ -1672,7 +1672,7 @@ HTML+EEX: - ".eex" ace_mode: text codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html language_id: 149 HTML+ERB: type: markup @@ -1685,7 +1685,7 @@ HTML+ERB: - ".erb.deface" ace_mode: text codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-erb + codemirror_mime_type: application/x-erb language_id: 150 HTML+PHP: type: markup @@ -1695,7 +1695,7 @@ HTML+PHP: - ".phtml" ace_mode: php codemirror_mode: php - codemirror_mime_mode: application/x-httpd-php + codemirror_mime_type: application/x-httpd-php language_id: 151 HTTP: type: data @@ -1704,13 +1704,13 @@ HTTP: tm_scope: source.httpspec ace_mode: text codemirror_mode: http - codemirror_mime_mode: message/http + codemirror_mime_type: message/http language_id: 152 Hack: type: programming ace_mode: php codemirror_mode: php - codemirror_mime_mode: application/x-httpd-php + codemirror_mime_type: application/x-httpd-php extensions: - ".hh" - ".php" @@ -1725,7 +1725,7 @@ Haml: - ".haml.deface" ace_mode: haml codemirror_mode: haml - codemirror_mime_mode: text/x-haml + codemirror_mime_type: text/x-haml color: "#ECE2A9" language_id: 154 Handlebars: @@ -1759,13 +1759,13 @@ Haskell: - runhaskell ace_mode: haskell codemirror_mode: haskell - codemirror_mime_mode: text/x-haskell + codemirror_mime_type: text/x-haskell language_id: 157 Haxe: type: programming ace_mode: haxe codemirror_mode: haxe - codemirror_mime_mode: text/x-haxe + codemirror_mime_type: text/x-haxe color: "#df7900" extensions: - ".hx" @@ -1797,7 +1797,7 @@ IDL: - ".dlm" ace_mode: text codemirror_mode: idl - codemirror_mime_mode: text/x-idl + codemirror_mime_type: text/x-idl language_id: 161 IGOR Pro: type: programming @@ -1822,7 +1822,7 @@ INI: - dosini ace_mode: ini codemirror_mode: properties - codemirror_mime_mode: text/x-properties + codemirror_mime_type: text/x-properties language_id: 163 IRC log: type: data @@ -1923,7 +1923,7 @@ JSON: group: JavaScript ace_mode: json codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json searchable: false extensions: - ".json" @@ -1943,7 +1943,7 @@ JSON5: tm_scope: source.js ace_mode: javascript codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json language_id: 175 JSONLD: type: data @@ -1958,7 +1958,7 @@ JSONiq: type: programming ace_mode: jsoniq codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json extensions: - ".jq" tm_scope: source.jq @@ -1971,7 +1971,7 @@ JSX: tm_scope: source.js.jsx ace_mode: javascript codemirror_mode: jsx - codemirror_mime_mode: text/jsx + codemirror_mime_type: text/jsx language_id: 178 Jade: group: HTML @@ -1982,7 +1982,7 @@ Jade: tm_scope: text.jade ace_mode: jade codemirror_mode: pug - codemirror_mime_mode: text/x-pug + codemirror_mime_type: text/x-pug language_id: 179 Jasmin: type: programming @@ -1995,7 +1995,7 @@ Java: type: programming ace_mode: java codemirror_mode: clike - codemirror_mime_mode: text/x-java + codemirror_mime_type: text/x-java color: "#b07219" extensions: - ".java" @@ -2011,14 +2011,14 @@ Java Server Pages: tm_scope: text.html.jsp ace_mode: jsp codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-jsp + codemirror_mime_type: application/x-jsp language_id: 182 JavaScript: type: programming tm_scope: source.js ace_mode: javascript codemirror_mode: javascript - codemirror_mime_mode: text/javascript + codemirror_mime_type: text/javascript color: "#f1e05a" aliases: - js @@ -2068,13 +2068,13 @@ Julia: color: "#a270ba" ace_mode: julia codemirror_mode: julia - codemirror_mime_mode: text/x-julia + codemirror_mime_type: text/x-julia language_id: 184 Jupyter Notebook: type: markup ace_mode: json codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json tm_scope: source.json color: "#DA5B0B" extensions: @@ -2105,7 +2105,7 @@ Kit: type: markup ace_mode: html codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html extensions: - ".kit" tm_scope: text.html.basic @@ -2120,7 +2120,7 @@ Kotlin: tm_scope: source.Kotlin ace_mode: text codemirror_mode: clike - codemirror_mime_mode: text/x-kotlin + codemirror_mime_type: text/x-kotlin language_id: 189 LFE: type: programming @@ -2131,7 +2131,7 @@ LFE: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 190 LLVM: type: programming @@ -2165,7 +2165,7 @@ LabVIEW: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 194 Lasso: type: programming @@ -2190,7 +2190,7 @@ Latte: tm_scope: text.html.smarty ace_mode: smarty codemirror_mode: smarty - codemirror_mime_mode: text/x-smarty + codemirror_mime_type: text/x-smarty language_id: 196 Lean: type: programming @@ -2207,7 +2207,7 @@ Less: tm_scope: source.css.less ace_mode: less codemirror_mode: css - codemirror_mime_mode: text/css + codemirror_mime_type: text/css color: "#A1D9A1" language_id: 198 Lex: @@ -2292,7 +2292,7 @@ Literate Haskell: tm_scope: text.tex.latex.haskell ace_mode: text codemirror_mode: haskell-literate - codemirror_mime_mode: text/x-literate-haskell + codemirror_mime_type: text/x-literate-haskell language_id: 207 LiveScript: type: programming @@ -2307,7 +2307,7 @@ LiveScript: - Slakefile ace_mode: livescript codemirror_mode: livescript - codemirror_mime_mode: text/x-livescript + codemirror_mime_type: text/x-livescript language_id: 208 Logos: type: programming @@ -2329,7 +2329,7 @@ LookML: type: programming ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml color: "#652B81" extensions: - ".lookml" @@ -2346,7 +2346,7 @@ Lua: type: programming ace_mode: lua codemirror_mode: lua - codemirror_mime_mode: text/x-lua + codemirror_mime_type: text/x-lua color: "#000080" extensions: - ".lua" @@ -2367,7 +2367,7 @@ M: - ".m" ace_mode: text codemirror_mode: mumps - codemirror_mime_mode: text/x-mumps + codemirror_mime_type: text/x-mumps language_id: 214 tm_scope: none M4: @@ -2406,7 +2406,7 @@ MTML: tm_scope: text.html.basic ace_mode: html codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html language_id: 218 MUF: type: programming @@ -2417,7 +2417,7 @@ MUF: tm_scope: none ace_mode: forth codemirror_mode: forth - codemirror_mime_mode: text/x-forth + codemirror_mime_type: text/x-forth language_id: 219 Makefile: type: programming @@ -2447,7 +2447,7 @@ Makefile: - make ace_mode: makefile codemirror_mode: cmake - codemirror_mime_mode: text/x-cmake + codemirror_mime_type: text/x-cmake language_id: 220 Mako: type: programming @@ -2461,7 +2461,7 @@ Markdown: type: prose ace_mode: markdown codemirror_mode: gfm - codemirror_mime_mode: text/x-gfm + codemirror_mime_type: text/x-gfm wrap: true extensions: - ".md" @@ -2496,7 +2496,7 @@ Mathematica: - mma ace_mode: text codemirror_mode: mathematica - codemirror_mime_mode: text/x-mathematica + codemirror_mime_type: text/x-mathematica language_id: 224 Matlab: type: programming @@ -2508,7 +2508,7 @@ Matlab: - ".m" ace_mode: matlab codemirror_mode: octave - codemirror_mime_mode: text/x-octave + codemirror_mime_type: text/x-octave language_id: 225 Maven POM: type: data @@ -2517,7 +2517,7 @@ Maven POM: - pom.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 226 Max: type: programming @@ -2535,7 +2535,7 @@ Max: tm_scope: source.json ace_mode: json codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json language_id: 227 MediaWiki: type: prose @@ -2565,7 +2565,7 @@ Metal: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 230 MiniD: type: programming @@ -2587,7 +2587,7 @@ Mirah: tm_scope: source.ruby ace_mode: ruby codemirror_mode: ruby - codemirror_mime_mode: text/x-ruby + codemirror_mime_type: text/x-ruby language_id: 232 Modelica: type: programming @@ -2596,7 +2596,7 @@ Modelica: tm_scope: source.modelica ace_mode: text codemirror_mode: modelica - codemirror_mime_mode: text/x-modelica + codemirror_mime_type: text/x-modelica language_id: 233 Modula-2: type: programming @@ -2667,7 +2667,7 @@ NSIS: - ".nsh" ace_mode: text codemirror_mode: nsis - codemirror_mime_mode: text/x-nsis + codemirror_mime_type: text/x-nsis language_id: 242 Nemerle: type: programming @@ -2702,7 +2702,7 @@ NetLogo: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 246 NewLisp: type: programming @@ -2717,7 +2717,7 @@ NewLisp: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 247 Nginx: type: markup @@ -2731,7 +2731,7 @@ Nginx: - nginx configuration file ace_mode: text codemirror_mode: nginx - codemirror_mime_mode: text/x-nginx-conf + codemirror_mime_type: text/x-nginx-conf color: "#9469E9" language_id: 248 Nimrod: @@ -2780,7 +2780,7 @@ Nu: tm_scope: source.nu ace_mode: scheme codemirror_mode: scheme - codemirror_mime_mode: text/x-scheme + codemirror_mime_type: text/x-scheme interpreters: - nush language_id: 253 @@ -2794,14 +2794,14 @@ NumPy: tm_scope: none ace_mode: text codemirror_mode: python - codemirror_mime_mode: text/x-python + codemirror_mime_type: text/x-python color: "#9C8AF9" language_id: 254 OCaml: type: programming ace_mode: ocaml codemirror_mode: mllike - codemirror_mime_mode: text/x-ocaml + codemirror_mime_type: text/x-ocaml color: "#3be133" extensions: - ".ml" @@ -2837,7 +2837,7 @@ Objective-C: - ".h" ace_mode: objectivec codemirror_mode: clike - codemirror_mime_mode: text/x-objectivec + codemirror_mime_type: text/x-objectivec language_id: 257 Objective-C++: type: programming @@ -2851,7 +2851,7 @@ Objective-C++: - ".mm" ace_mode: objectivec codemirror_mode: clike - codemirror_mime_mode: text/x-objectivec + codemirror_mime_type: text/x-objectivec language_id: 258 Objective-J: type: programming @@ -2897,7 +2897,7 @@ OpenCL: tm_scope: source.c ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 263 OpenEdge ABL: type: programming @@ -2921,7 +2921,7 @@ OpenRC runscript: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 265 OpenSCAD: type: programming @@ -2963,7 +2963,7 @@ Oz: tm_scope: source.oz ace_mode: text codemirror_mode: oz - codemirror_mime_mode: text/x-oz + codemirror_mime_type: text/x-oz language_id: 270 PAWN: type: programming @@ -2979,7 +2979,7 @@ PHP: tm_scope: text.html.php ace_mode: php codemirror_mode: php - codemirror_mime_mode: application/x-httpd-php + codemirror_mime_type: application/x-httpd-php color: "#4F5D95" extensions: - ".php" @@ -3003,7 +3003,7 @@ PLSQL: type: programming ace_mode: sql codemirror_mode: sql - codemirror_mime_mode: text/x-plsql + codemirror_mime_type: text/x-plsql tm_scope: none color: "#dad8d8" extensions: @@ -3019,7 +3019,7 @@ PLpgSQL: type: programming ace_mode: pgsql codemirror_mode: sql - codemirror_mime_mode: text/x-sql + codemirror_mime_type: text/x-sql tm_scope: source.sql extensions: - ".sql" @@ -3097,14 +3097,14 @@ Pascal: - instantfpc ace_mode: pascal codemirror_mode: pascal - codemirror_mime_mode: text/x-pascal + codemirror_mime_type: text/x-pascal language_id: 281 Perl: type: programming tm_scope: source.perl ace_mode: perl codemirror_mode: perl - codemirror_mime_mode: text/x-perl + codemirror_mime_type: text/x-perl color: "#0298c3" extensions: - ".pl" @@ -3143,7 +3143,7 @@ Perl6: tm_scope: source.perl6fe ace_mode: perl codemirror_mode: perl - codemirror_mime_mode: text/x-perl + codemirror_mime_type: text/x-perl language_id: 283 Pickle: type: data @@ -3184,7 +3184,7 @@ Pod: type: prose ace_mode: perl codemirror_mode: perl - codemirror_mime_mode: text/x-perl + codemirror_mime_type: text/x-perl wrap: true extensions: - ".pod" @@ -3231,7 +3231,7 @@ PowerShell: type: programming ace_mode: powershell codemirror_mode: powershell - codemirror_mime_mode: application/x-powershell + codemirror_mime_type: application/x-powershell aliases: - posh extensions: @@ -3278,7 +3278,7 @@ Protocol Buffer: tm_scope: source.protobuf ace_mode: protobuf codemirror_mode: protobuf - codemirror_mime_mode: text/x-protobuf + codemirror_mime_type: text/x-protobuf language_id: 297 Public Key: type: data @@ -3297,7 +3297,7 @@ Puppet: - Modulefile ace_mode: text codemirror_mode: puppet - codemirror_mime_mode: text/x-puppet + codemirror_mime_type: text/x-puppet tm_scope: source.puppet language_id: 299 Pure Data: @@ -3325,13 +3325,13 @@ PureScript: tm_scope: source.purescript ace_mode: haskell codemirror_mode: haskell - codemirror_mime_mode: text/x-haskell + codemirror_mime_type: text/x-haskell language_id: 302 Python: type: programming ace_mode: python codemirror_mode: python - codemirror_mime_mode: text/x-python + codemirror_mime_type: text/x-python color: "#3572A5" extensions: - ".py" @@ -3407,13 +3407,13 @@ R: - Rscript ace_mode: r codemirror_mode: r - codemirror_mime_mode: text/x-rsrc + codemirror_mime_type: text/x-rsrc language_id: 307 RAML: type: markup ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml tm_scope: source.yaml color: "#77d9fb" extensions: @@ -3460,14 +3460,14 @@ RHTML: - html+ruby ace_mode: rhtml codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-erb + codemirror_mime_type: application/x-erb language_id: 312 RMarkdown: type: prose wrap: true ace_mode: markdown codemirror_mode: gfm - codemirror_mime_mode: text/x-gfm + codemirror_mime_type: text/x-gfm extensions: - ".rmd" tm_scope: source.gfm @@ -3481,7 +3481,7 @@ RPM Spec: - specfile ace_mode: text codemirror_mode: rpm - codemirror_mime_mode: text/x-rpm-spec + codemirror_mime_type: text/x-rpm-spec language_id: 314 RUNOFF: type: markup @@ -3585,7 +3585,7 @@ Rouge: type: programming ace_mode: clojure codemirror_mode: clojure - codemirror_mime_mode: text/x-clojure + codemirror_mime_type: text/x-clojure color: "#cc0088" extensions: - ".rg" @@ -3595,7 +3595,7 @@ Ruby: type: programming ace_mode: ruby codemirror_mode: ruby - codemirror_mime_mode: text/x-ruby + codemirror_mime_type: text/x-ruby color: "#701516" aliases: - jruby @@ -3658,7 +3658,7 @@ Rust: - ".rs.in" ace_mode: rust codemirror_mode: rust - codemirror_mime_mode: text/x-rustsrc + codemirror_mime_type: text/x-rustsrc language_id: 327 SAS: type: programming @@ -3668,7 +3668,7 @@ SAS: tm_scope: source.sas ace_mode: text codemirror_mode: sas - codemirror_mime_mode: text/x-sas + codemirror_mime_type: text/x-sas language_id: 328 SCSS: type: markup @@ -3676,7 +3676,7 @@ SCSS: group: CSS ace_mode: scss codemirror_mode: css - codemirror_mime_mode: text/x-scss + codemirror_mime_type: text/x-scss extensions: - ".scss" color: "#CF649A" @@ -3705,7 +3705,7 @@ SPARQL: tm_scope: source.sparql ace_mode: text codemirror_mode: sparql - codemirror_mime_mode: application/sparql-query + codemirror_mime_type: application/sparql-query extensions: - ".sparql" - ".rq" @@ -3724,7 +3724,7 @@ SQL: tm_scope: source.sql ace_mode: sql codemirror_mode: sql - codemirror_mime_mode: text/x-sql + codemirror_mime_type: text/x-sql extensions: - ".sql" - ".cql" @@ -3739,7 +3739,7 @@ SQLPL: type: programming ace_mode: sql codemirror_mode: sql - codemirror_mime_mode: text/x-sql + codemirror_mime_type: text/x-sql tm_scope: source.sql extensions: - ".sql" @@ -3751,7 +3751,7 @@ SRecode Template: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp extensions: - ".srt" language_id: 335 @@ -3770,7 +3770,7 @@ SVG: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 337 Sage: type: programming @@ -3781,7 +3781,7 @@ Sage: tm_scope: source.python ace_mode: python codemirror_mode: python - codemirror_mime_mode: text/x-python + codemirror_mime_type: text/x-python language_id: 338 SaltStack: type: programming @@ -3794,7 +3794,7 @@ SaltStack: tm_scope: source.yaml.salt ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml language_id: 339 Sass: type: markup @@ -3804,14 +3804,14 @@ Sass: - ".sass" ace_mode: sass codemirror_mode: sass - codemirror_mime_mode: text/x-sass + codemirror_mime_type: text/x-sass color: "#CF649A" language_id: 340 Scala: type: programming ace_mode: scala codemirror_mode: clike - codemirror_mime_mode: text/x-scala + codemirror_mime_type: text/x-scala color: "#c22d40" extensions: - ".scala" @@ -3846,7 +3846,7 @@ Scheme: - r6rs ace_mode: scheme codemirror_mode: scheme - codemirror_mime_mode: text/x-scheme + codemirror_mime_type: text/x-scheme language_id: 343 Scilab: type: programming @@ -3899,7 +3899,7 @@ Shell: - zsh ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 346 ShellSession: type: programming @@ -3911,7 +3911,7 @@ ShellSession: tm_scope: text.shell-session ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 347 Shen: type: programming @@ -3938,7 +3938,7 @@ Slim: tm_scope: text.slim ace_mode: text codemirror_mode: slim - codemirror_mime_mode: text/x-slim + codemirror_mime_type: text/x-slim language_id: 350 Smali: type: programming @@ -3957,7 +3957,7 @@ Smalltalk: - squeak ace_mode: text codemirror_mode: smalltalk - codemirror_mime_mode: text/x-stsrc + codemirror_mime_type: text/x-stsrc language_id: 352 Smarty: type: programming @@ -3965,7 +3965,7 @@ Smarty: - ".tpl" ace_mode: smarty codemirror_mode: smarty - codemirror_mime_mode: text/x-smarty + codemirror_mime_type: text/x-smarty tm_scope: text.html.smarty language_id: 353 SourcePawn: @@ -3988,7 +3988,7 @@ Squirrel: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 355 Stan: type: programming @@ -4011,7 +4011,7 @@ Standard ML: tm_scope: source.ml ace_mode: text codemirror_mode: mllike - codemirror_mime_mode: text/x-ocaml + codemirror_mime_type: text/x-ocaml language_id: 357 Stata: type: programming @@ -4059,7 +4059,7 @@ Swift: - ".swift" ace_mode: text codemirror_mode: swift - codemirror_mime_mode: text/x-swift + codemirror_mime_type: text/x-swift language_id: 362 SystemVerilog: type: programming @@ -4070,7 +4070,7 @@ SystemVerilog: - ".vh" ace_mode: verilog codemirror_mode: verilog - codemirror_mime_mode: text/x-systemverilog + codemirror_mime_type: text/x-systemverilog language_id: 363 TLA: type: programming @@ -4086,7 +4086,7 @@ TOML: tm_scope: source.toml ace_mode: toml codemirror_mode: toml - codemirror_mime_mode: text/x-toml + codemirror_mime_type: text/x-toml language_id: 365 TXL: type: programming @@ -4107,7 +4107,7 @@ Tcl: - wish ace_mode: tcl codemirror_mode: tcl - codemirror_mime_mode: text/x-tcl + codemirror_mime_type: text/x-tcl language_id: 367 Tcsh: type: programming @@ -4118,14 +4118,14 @@ Tcsh: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 368 TeX: type: markup color: "#3D6117" ace_mode: tex codemirror_mode: stex - codemirror_mime_mode: text/x-stex + codemirror_mime_type: text/x-stex wrap: true aliases: - latex @@ -4160,7 +4160,7 @@ Terra: color: "#00004c" ace_mode: lua codemirror_mode: lua - codemirror_mime_mode: text/x-lua + codemirror_mime_type: text/x-lua interpreters: - lua language_id: 371 @@ -4194,7 +4194,7 @@ Textile: type: prose ace_mode: textile codemirror_mode: textile - codemirror_mime_mode: text/x-textile + codemirror_mime_type: text/x-textile wrap: true extensions: - ".textile" @@ -4223,7 +4223,7 @@ Turtle: tm_scope: source.turtle ace_mode: text codemirror_mode: turtle - codemirror_mime_mode: text/turtle + codemirror_mime_type: text/turtle language_id: 376 Twig: type: markup @@ -4233,7 +4233,7 @@ Twig: tm_scope: text.html.twig ace_mode: twig codemirror_mode: twig - codemirror_mime_mode: text/x-twig + codemirror_mime_type: text/x-twig language_id: 377 TypeScript: type: programming @@ -4246,14 +4246,14 @@ TypeScript: tm_scope: source.ts ace_mode: typescript codemirror_mode: javascript - codemirror_mime_mode: application/typescript + codemirror_mime_type: application/typescript language_id: 378 Unified Parallel C: type: programming group: C ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc color: "#4e3617" extensions: - ".upc" @@ -4263,7 +4263,7 @@ Unity3D Asset: type: data ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml extensions: - ".anim" - ".asset" @@ -4279,7 +4279,7 @@ Uno: - ".uno" ace_mode: csharp codemirror_mode: clike - codemirror_mime_mode: text/x-csharp + codemirror_mime_type: text/x-csharp tm_scope: source.cs language_id: 381 UnrealScript: @@ -4290,7 +4290,7 @@ UnrealScript: tm_scope: source.java ace_mode: java codemirror_mode: clike - codemirror_mime_mode: text/x-java + codemirror_mime_type: text/x-java language_id: 382 UrWeb: type: programming @@ -4325,7 +4325,7 @@ VHDL: - ".vhw" ace_mode: vhdl codemirror_mode: vhdl - codemirror_mime_mode: text/x-vhdl + codemirror_mime_type: text/x-vhdl language_id: 385 Vala: type: programming @@ -4343,7 +4343,7 @@ Verilog: - ".veo" ace_mode: verilog codemirror_mode: verilog - codemirror_mime_mode: text/x-verilog + codemirror_mime_type: text/x-verilog language_id: 387 VimL: type: programming @@ -4382,7 +4382,7 @@ Visual Basic: - vbnet ace_mode: text codemirror_mode: vb - codemirror_mime_mode: text/x-vb + codemirror_mime_type: text/x-vb language_id: 389 Volt: type: programming @@ -4392,7 +4392,7 @@ Volt: tm_scope: source.d ace_mode: d codemirror_mode: d - codemirror_mime_mode: text/x-d + codemirror_mime_type: text/x-d language_id: 390 Vue: type: markup @@ -4431,7 +4431,7 @@ WebIDL: tm_scope: source.webidl ace_mode: text codemirror_mode: webidl - codemirror_mime_mode: text/x-webidl + codemirror_mime_type: text/x-webidl language_id: 395 World of Warcraft Addon Data: type: data @@ -4458,13 +4458,13 @@ XC: tm_scope: source.xc ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 398 XML: type: data ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml aliases: - rss - xsd @@ -4574,7 +4574,7 @@ XPages: tm_scope: none ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 400 XProc: type: programming @@ -4584,7 +4584,7 @@ XProc: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 401 XQuery: type: programming @@ -4597,7 +4597,7 @@ XQuery: - ".xqy" ace_mode: xquery codemirror_mode: xquery - codemirror_mime_mode: application/xquery + codemirror_mime_type: application/xquery tm_scope: source.xq language_id: 402 XS: @@ -4607,7 +4607,7 @@ XS: tm_scope: source.c ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 403 XSLT: type: programming @@ -4619,7 +4619,7 @@ XSLT: tm_scope: text.xml.xsl ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml color: "#EB8CEB" language_id: 404 Xojo: @@ -4657,7 +4657,7 @@ YAML: - ".clang-format" ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml language_id: 407 YANG: type: data @@ -4715,7 +4715,7 @@ edn: type: data ace_mode: clojure codemirror_mode: clojure - codemirror_mime_mode: text/x-clojure + codemirror_mime_type: text/x-clojure extensions: - ".edn" tm_scope: source.clojure @@ -4764,13 +4764,13 @@ reStructuredText: - ".rst.txt" ace_mode: text codemirror_mode: rst - codemirror_mime_mode: text/x-rst + codemirror_mime_type: text/x-rst language_id: 419 wisp: type: programming ace_mode: clojure codemirror_mode: clojure - codemirror_mime_mode: text/x-clojure + codemirror_mime_type: text/x-clojure color: "#7582D1" extensions: - ".wisp" diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 3b03ca81..1b878847 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -126,7 +126,7 @@ class TestGrammars < Minitest::Test private def submodule_paths - @submodule_paths ||= `git config --list --file "#{File.join(ROOT, ".gitmodules")}"`.lines.grep(/\.path=/).map { |line| line.chomp.split("=", 2).last } + @submodule_paths ||= `git config --list --file "#{File.join(ROOT, ".gitmodules")}"`.lines.grep(/\.path=/).map { |line| line.chomp.split("=", 2).last }.reject { |path| path =~ /CodeMirror/ } end # Returns a hash of submodules in the form of submodule_path => license diff --git a/test/test_language.rb b/test/test_language.rb index 48391e59..1f6d19d2 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -358,11 +358,11 @@ class TestLanguage < Minitest::Test assert_equal 'clike', Language['C++'].codemirror_mode end - def test_codemirror_mime_mode - assert_equal 'text/x-ruby', Language['Ruby'].codemirror_mime_mode - assert_equal 'text/javascript', Language['JavaScript'].codemirror_mime_mode - assert_equal 'text/x-csrc', Language['C'].codemirror_mime_mode - assert_equal 'text/x-c++src', Language['C++'].codemirror_mime_mode + def test_codemirror_mime_type + assert_equal 'text/x-ruby', Language['Ruby'].codemirror_mime_type + assert_equal 'text/javascript', Language['JavaScript'].codemirror_mime_type + assert_equal 'text/x-csrc', Language['C'].codemirror_mime_type + assert_equal 'text/x-c++src', Language['C++'].codemirror_mime_type end def test_wrap @@ -454,9 +454,9 @@ class TestLanguage < Minitest::Test def test_codemirror_modes_present Language.all.each do |language| - if language.codemirror_mode || language.codemirror_mime_mode + if language.codemirror_mode || language.codemirror_mime_type assert language.codemirror_mode, "#{language.inspect} missing CodeMirror mode" - assert language.codemirror_mime_mode, "#{language.inspect} missing CodeMirror MIME mode" + assert language.codemirror_mime_type, "#{language.inspect} missing CodeMirror MIME mode" end end end @@ -472,17 +472,17 @@ class TestLanguage < Minitest::Test def test_codemirror_mode_and_mime_defined_by_meta_mapping meta = File.read(File.expand_path("../../vendor/CodeMirror/mode/meta.js", __FILE__)) Language.all.each do |language| - next unless language.codemirror_mode && language.codemirror_mime_mode - assert meta.match(/^.+#{Regexp.escape(language.codemirror_mime_mode)}.+#{Regexp.escape(language.codemirror_mode)}.+$/), "#{language.inspect}: #{language.codemirror_mime_mode} not defined under #{language.codemirror_mode}" + next unless language.codemirror_mode && language.codemirror_mime_type + assert meta.match(/^.+#{Regexp.escape(language.codemirror_mime_type)}.+#{Regexp.escape(language.codemirror_mode)}.+$/), "#{language.inspect}: #{language.codemirror_mime_type} not defined under #{language.codemirror_mode}" end end def test_codemirror_mime_declared_in_mode_file Language.all.each do |language| - next unless language.codemirror_mode && language.codemirror_mime_mode + next unless language.codemirror_mode && language.codemirror_mime_type filename = File.expand_path("../../vendor/CodeMirror/mode/#{language.codemirror_mode}/#{language.codemirror_mode}.js", __FILE__) assert File.exist?(filename), "#{filename} does not exist" - assert File.read(filename).match(language.codemirror_mime_mode), "#{language.inspect}: #{language.codemirror_mime_mode} not defined in #{filename}" + assert File.read(filename).match(language.codemirror_mime_type), "#{language.inspect}: #{language.codemirror_mime_type} not defined in #{filename}" end end