A hash for registering syntax implementations.
Return an array of the names of supported syntaxes.
# File lib/syntax.rb, line 32 32: def all 33: lang_dir = File.join(File.dirname(__FILE__), "syntax", "lang") 34: Dir["#{lang_dir}/*.rb"].map { |path| File.basename(path, ".rb") } 35: end
Load the implementation of the requested syntax. If the syntax cannot be found, or if it cannot be loaded for whatever reason, the Default syntax handler will be returned.
# File lib/syntax.rb, line 22 22: def load( syntax ) 23: begin 24: require "syntax/lang/#{syntax}" 25: rescue LoadError 26: end 27: SYNTAX[ syntax ].new 28: end
Return an array of the names of supported syntaxes.
# File lib/syntax.rb, line 32 32: def all 33: lang_dir = File.join(File.dirname(__FILE__), "syntax", "lang") 34: Dir["#{lang_dir}/*.rb"].map { |path| File.basename(path, ".rb") } 35: end
Load the implementation of the requested syntax. If the syntax cannot be found, or if it cannot be loaded for whatever reason, the Default syntax handler will be returned.
# File lib/syntax.rb, line 22 22: def load( syntax ) 23: begin 24: require "syntax/lang/#{syntax}" 25: rescue LoadError 26: end 27: SYNTAX[ syntax ].new 28: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.