module Syntax
Constants
- SYNTAX
-
A hash for registering syntax implementations.
Public Class Methods
Source
# File lib/syntax.rb, line 32 def all lang_dir = File.join(File.dirname(__FILE__), "syntax", "lang") Dir["#{lang_dir}/*.rb"].map { |path| File.basename(path, ".rb") } end
Return an array of the names of supported syntaxes.
Source
# File lib/syntax.rb, line 22 def load( syntax ) begin require "syntax/lang/#{syntax}" rescue LoadError end SYNTAX[ syntax ].new 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.
Private Instance Methods
Source
# File lib/syntax.rb, line 32 def all lang_dir = File.join(File.dirname(__FILE__), "syntax", "lang") Dir["#{lang_dir}/*.rb"].map { |path| File.basename(path, ".rb") } end
Return an array of the names of supported syntaxes.
Source
# File lib/syntax.rb, line 22 def load( syntax ) begin require "syntax/lang/#{syntax}" rescue LoadError end SYNTAX[ syntax ].new 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.