Sha256: f844bf117a1308225de3a9847dfdd5f33904107a5a47997187fae8e119b98a0a

Contents?: true

Size: 739 Bytes

Versions: 4

Compression:

Stored size: 739 Bytes

Contents

class NiftyLayoutGenerator < Rails::Generator::Base
  def initialize(runtime_args, runtime_options = {})
    super
    @name = @args.first || 'application'
  end
  
  def manifest
    record do |m|
      m.directory 'app/views/layouts'
      m.directory 'public/stylesheets'
      m.directory 'app/helpers'

      m.template "layout.html.erb", "app/views/layouts/#{file_name}.html.erb"
      m.file     "stylesheet.css",  "public/stylesheets/#{file_name}.css"
      m.file     "helper.rb",       "app/helpers/layout_helper.rb"
    end
  end
  
  def file_name
    @name.underscore
  end

  protected
    def banner
      <<-EOS
Creates generic layout, stylesheet, and helper files.

USAGE: #{$0} #{spec.name} [layout_name]
EOS
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ryanb-nifty-generators-0.1.0 rails_generators/nifty_layout/nifty_layout_generator.rb
ryanb-nifty-generators-0.1.1 rails_generators/nifty_layout/nifty_layout_generator.rb
ryanb-nifty-generators-0.1.3 rails_generators/nifty_layout/nifty_layout_generator.rb
ryanb-nifty-generators-0.1.4 rails_generators/nifty_layout/nifty_layout_generator.rb