Merge branch 'master' into brightscript_support

Conflicts:
	lib/linguist/samples.json
This commit is contained in:
Max Peterson
2013-12-05 13:02:00 -06:00
9 changed files with 78 additions and 23 deletions

View File

@@ -1,6 +1,10 @@
require 'escape_utils'
require 'pygments'
require 'yaml'
begin
require 'json'
rescue LoadError
end
require 'linguist/classifier'
require 'linguist/samples'
@@ -455,7 +459,16 @@ module Linguist
filenames = Samples::DATA['filenames']
popular = YAML.load_file(File.expand_path("../popular.yml", __FILE__))
YAML.load_file(File.expand_path("../languages.yml", __FILE__)).each do |name, options|
languages_yml = File.expand_path("../languages.yml", __FILE__)
languages_json = File.expand_path("../languages.json", __FILE__)
if File.exist?(languages_json) && defined?(JSON)
languages = JSON.load(File.read(languages_json))
else
languages = YAML.load_file(languages_yml)
end
languages.each do |name, options|
options['extensions'] ||= []
options['filenames'] ||= []

View File

@@ -70,6 +70,7 @@ Ada:
Agda:
type: programming
color: "#467C91"
primary_extension: .agda
ApacheConf:
@@ -384,7 +385,7 @@ D-ObjDump:
DM:
type: programming
color: "#075ff1"
lexer: Text only
lexer: C++
primary_extension: .dm
aliases:
- byond
@@ -752,6 +753,8 @@ JSON:
- .sublime_session
- .sublime-settings
- .sublime-workspace
filenames:
- composer.lock
Jade:
group: HTML
@@ -947,15 +950,17 @@ Matlab:
Max:
type: programming
color: "#ce279c"
lexer: Text only
lexer: JSON
aliases:
- max/msp
- maxmsp
search_term: max/msp
primary_extension: .mxt
primary_extension: .maxpat
extensions:
- .maxhelp
- .maxpat
- .maxproj
- .mxt
- .pat
MiniD: # Legacy
searchable: false
@@ -1478,6 +1483,7 @@ Tcsh:
TeX:
type: markup
color: "#3D6117"
ace_mode: latex
aliases:
- latex
@@ -1545,6 +1551,14 @@ VHDL:
lexer: vhdl
color: "#543978"
primary_extension: .vhdl
extensions:
- .vhd
- .vhf
- .vhi
- .vho
- .vhs
- .vht
- .vhw
Vala:
type: programming
@@ -1616,6 +1630,7 @@ XML:
- .grxml
- .jelly
- .kml
- .launch
- .mxml
- .plist
- .pluginspec
@@ -1625,6 +1640,7 @@ XML:
- .rdf
- .rss
- .scxml
- .srdf
- .svg
- .tmCommand
- .tmLanguage
@@ -1633,12 +1649,14 @@ XML:
- .tmTheme
- .tml
- .ui
- .urdf
- .vxml
- .wsdl
- .wxi
- .wxl
- .wxs
- .x3d
- .xacro
- .xaml
- .xlf
- .xliff
@@ -1691,6 +1709,7 @@ YAML:
primary_extension: .yml
extensions:
- .reek
- .rviz
- .yaml
eC:

View File

@@ -152,9 +152,7 @@
".script!"
],
"JSON": [
".json",
".maxhelp",
".maxpat"
".json"
],
"Julia": [
".jl"
@@ -208,6 +206,8 @@
".m"
],
"Max": [
".maxhelp",
".maxpat",
".mxt"
],
"Monkey": [
@@ -23186,10 +23186,10 @@
"logger": 2
},
"JSON": {
"{": 143,
"}": 143,
"[": 165,
"]": 165,
"{": 17,
"}": 17,
"[": 2,
"]": 2,
"true": 3
},
"Julia": {
@@ -28521,6 +28521,10 @@
"contents.colheaders": 1
},
"Max": {
"{": 126,
"}": 126,
"[": 163,
"]": 163,
"max": 1,
"v2": 1,
";": 39,
@@ -43668,7 +43672,7 @@
"Jade": 3,
"Java": 8987,
"JavaScript": 76934,
"JSON": 619,
"JSON": 41,
"Julia": 247,
"Kotlin": 155,
"KRL": 25,
@@ -43685,7 +43689,7 @@
"Makefile": 50,
"Markdown": 1,
"Matlab": 11942,
"Max": 136,
"Max": 714,
"Monkey": 207,
"MoonScript": 1718,
"Nemerle": 17,
@@ -43795,7 +43799,7 @@
"Jade": 1,
"Java": 6,
"JavaScript": 20,
"JSON": 5,
"JSON": 3,
"Julia": 1,
"Kotlin": 1,
"KRL": 1,
@@ -43812,7 +43816,7 @@
"Makefile": 2,
"Markdown": 1,
"Matlab": 39,
"Max": 1,
"Max": 3,
"Monkey": 1,
"MoonScript": 1,
"Nemerle": 1,
@@ -43877,5 +43881,5 @@
"Xtend": 2,
"YAML": 1
},
"md5": "d77910fe214f3654d7538485c7388f89"
"md5": "647da23cd1eb02653f50ff9bfbb6e70d"
}

View File

@@ -1,4 +1,8 @@
require 'yaml'
begin
require 'json'
rescue LoadError
require 'yaml'
end
require 'linguist/md5'
require 'linguist/classifier'
@@ -14,7 +18,8 @@ module Linguist
# Hash of serialized samples object
if File.exist?(PATH)
DATA = YAML.load_file(PATH)
serializer = defined?(JSON) ? JSON : YAML
DATA = serializer.load(File.read(PATH))
end
# Public: Iterate over each sample.