Module: Syntax

### Home Classes Methods

### In Files

- lib/syntax.rb
- lib/syntax/common.rb
- lib/syntax/version.rb
- lib/syntax/convertors/abstract.rb
- lib/syntax/convertors/html.rb
- lib/syntax/lang/ruby.rb
- lib/syntax/lang/xml.rb
- lib/syntax/lang/yaml.rb

### Namespace

- MODULE Syntax::Convertors
- MODULE Syntax::Version
- CLASS Syntax::Default
- CLASS Syntax::Ruby
- CLASS Syntax::Token
- CLASS Syntax::Tokenizer
- CLASS Syntax::XML
- CLASS Syntax::YAML

### Methods

- ::all
- ::load

### Class/Module Index

Quicksearch

- Syntax
- Syntax::Convertors
- Syntax::Convertors::Abstract
- Syntax::Convertors::HTML
- Syntax::Default
- Syntax::Ruby
- Syntax::Token
- Syntax::Tokenizer
- Syntax::Version
- Syntax::XML
- Syntax::YAML

No matching classes.

# Syntax

### Constants

SYNTAX

  A hash for registering syntax implementations.

### Public Class Methods

all() click to toggle source

Return an array of the names of supported syntaxes.

    # 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

load( syntax ) click to toggle source

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
    def load( syntax )
      begin
        require "syntax/lang/#{syntax}"
      rescue LoadError
      end
      SYNTAX[ syntax ].new
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.