sawa sawa - 10 months ago 34
Ruby Question

Getting the list of available languages

How can I get the list of available languages (the short symbol to be passed when calling a method that represents the language) for CodeRay syntax highlighter?

I tried

require "coderay"

but that doesn't seem to give the information. (Even if I were able to get the constants that correspond to the languages, I still need another step to get the symbols that correspond to them.)

A related question is, I can do something like:

CodeRay::Scanners::Ruby # => CodeRay::Scanners::Ruby

doesn't include that. Why is that?


Method you are looking for is:

#=> [:c, :clojure, :cpp, :css, :debug, :delphi, :diff, :erb, :go, :groovy,
#    :haml, :html, :java, :java_script, :json, :lua, :php, :python, :raydebug,
#    :ruby, :sass, :scanner, :sql, :taskpaper, :text, :xml, :yaml]