Last active
August 29, 2015 14:10
-
-
Save gjtorikian/3e6b307243ff9b3a9b34 to your computer and use it in GitHub Desktop.
Linguist / Ace mode grabber thing
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 'yaml' | |
require 'json' | |
languages = YAML.load_file("lib/linguist/languages.yml") | |
linguist_names = [] | |
languages.each_pair do |language, values| | |
if values["ace_mode"] | |
linguist_names << values["ace_mode"] | |
else | |
linguist_names << language.downcase if !values["tm_scope"].nil? && values["tm_scope"] != "none" | |
end | |
end | |
linguist_names.uniq!.sort! | |
ace_modes = [] | |
ace_github_modes = JSON.parse `curl https://api.github.com/repos/ajaxorg/ace/contents/lib/ace/mode` | |
ace_github_modes.each do |ace_github_mode| | |
ace_modes << File.basename(ace_github_mode["name"], ".js") if ace_github_mode["name"] !~ /_highlight_rules|_test|_worker/ | |
end | |
ace_modes.uniq!.sort! | |
missing_modes = linguist_names - ace_modes | |
puts "\nHere's (probably) stuff that needs an `ace_mode` or a new mode in Ace: \n#{missing_modes.join("\n")}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment