class Object

Constants

APP_ROOT
PROJECT_NAME
RAILS_ROOT
TMP_ROOT

Must set before requiring generator libs.

Public Class Methods

lookup_missing_generator(class_id) click to toggle source

Lookup missing generators using const_missing. This allows any generator to reference another without having to know its location: RubyGems, ~/.rubigen/generators, and APP_ROOT/generators.

# File lib/rubigen/lookup.rb, line 8
def lookup_missing_generator(class_id)
  if md = /(.+)Generator$/.match(class_id.to_s)
    name = md.captures.first.demodulize.underscore
    RubiGen::Base.active.lookup(name).klass
  else
    const_missing_before_generators(class_id)
  end
end

Public Instance Methods

convert_syntax(syntax, source) click to toggle source
# File script/txt2html, line 40
def convert_syntax(syntax, source)
  return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
end