Parent

Included Modules

Merb::Generators::Generator

Public Class Methods

new(*args) click to toggle source
# File lib/merb-gen/generator.rb, line 32
def initialize(*args)
  Merb::Config.setup({
    :log_level        => :fatal,
    :log_delimiter    => " ~ ",
    :log_auto_flush   => false,
    :reload_templates => false,
    :reload_classes   => false
  })

  Merb::BootLoader::Logger.run
  Merb::BootLoader::BuildFramework.run
  Merb::BootLoader::Dependencies.run
  
  super
  options[:orm] ||= Merb.orm
  options[:testing_framework] ||= Merb.test_framework
  options[:template_engine] ||= Merb.template_engine
end
source_root() click to toggle source
# File lib/merb-gen/generator.rb, line 77
def self.source_root
  File.join(File.dirname(__FILE__), '..', 'generators', 'templates')
end

Public Instance Methods

go_up(num) click to toggle source

Returns a string of num times ‘..’, useful for example in tests for namespaced generators to find the spec_helper higher up in the directory structure.

@param num<Integer> number of directories up @return <String> concatenated string

# File lib/merb-gen/generator.rb, line 73
def go_up(num)
  (["'..'"] * num).join(', ')
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.