Module: Syntax

Defined in:
lib/syntax.rb,
lib/syntax/xml.rb,
lib/syntax/ruby.rb,
lib/syntax/yaml.rb,
lib/syntax/common.rb,
lib/syntax/version.rb,
lib/syntax/convertors/html.rb

Defined Under Namespace

Modules: Convertors, Version Classes: Default, Ruby, Token, Tokenizer, XML, YAML

Constant Summary collapse

SYNTAX =

A hash for registering syntax implementations.

Hash.new( Default )

Class Method Summary collapse

Class Method Details

.load(syntax) ⇒ Object

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.



22
23
24
25
26
27
28
# File 'lib/syntax.rb', line 22

def load( syntax )
  begin
    require "syntax/#{syntax}"
  rescue LoadError
  end
  SYNTAX[ syntax ].new
end