require "#{File.dirname(__FILE__)}/manifests/layout.rb" module RulesView module Generators class LayoutGenerator < Rails::Generators::Base source_root File.expand_path(File.dirname(__FILE__) + "/manifests/templates") def initialize(runtime_args, *runtime_options) super @layout_name = runtime_args[0] unless runtime_args.length < 1 end def install if @layout_name.blank? puts " ***************** layout_name required ***************** " else LayoutManifest.populate_record(self, @layout_name) end puts LayoutGenerator.description end def self.description <<-DESCRIPTION ******************************************************************* To install and modify the rules_view layout > script/rails generate rules_view:layout [layout_name] Then set the layout to use in the controller class MyCoolController < ApplicationController layout '[layout_name]' ... ******************************************************************* DESCRIPTION end desc(description) end end end