Sha256: 966fa2c4d0e5b95188bbf17e4cfb710228435d9312801178dbfd827d20882b3a

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

require "#{File.dirname(__FILE__)}/manifests/rules_view_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  
          RulesViewLayoutManifest.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    

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rules_view-0.0.2 generators/layout_generator.rb