Skip to content

Instantly share code, notes, and snippets.

@gjtorikian
Last active August 29, 2015 14:10
Show Gist options
  • Save gjtorikian/3e6b307243ff9b3a9b34 to your computer and use it in GitHub Desktop.
Save gjtorikian/3e6b307243ff9b3a9b34 to your computer and use it in GitHub Desktop.
Linguist / Ace mode grabber thing
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