Sha256: 2c23bad89fa31dfe027b57c1a3c51f6d08316dbfbf4826a451d78800f63b2e15

Contents?: true

Size: 1.65 KB

Versions: 5

Compression:

Stored size: 1.65 KB

Contents

class RottenLayoutGenerator < 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 'app/views/shared'
      m.directory 'app/stylesheets/public'
      m.directory 'app/stylesheets/sass'
      m.directory 'app/helpers'
      
      
      m.template "layout.html.haml", "app/views/layouts/application.html.haml"
      
      m.file "shared_flash_messages.html.haml", "app/views/shared/_flash_messages.html.haml"
      m.file "shared_footer.html.haml", "app/views/shared/_footer.html.haml"
      m.file "shared_analytics.html.haml", "app/views/shared/_analytics.html.haml"
      
      m.file     "sass/screen.sass",  "app/stylesheets/public/screen.sass"
      m.file     "sass/print.sass",  "app/stylesheets/public/print.sass"
      m.file     "sass/handheld.sass",  "app/stylesheets/public/handheld.sass"
      m.file     "sass/ie.sass",  "app/stylesheets/public/ie.sass"
      
      m.file     "sass/colour.sass",  "app/stylesheets/sass/colour.sass"
      m.file     "sass/form.sass",  "app/stylesheets/sass/form.sass"
      m.file     "sass/layout.sass",  "app/stylesheets/sass/layout.sass"
      m.file     "sass/reset.sass",  "app/stylesheets/sass/reset.sass"
      m.file     "sass/type.sass",  "app/stylesheets/sass/type.sass"

      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

5 entries across 5 versions & 1 rubygems

Version Path
PeterCoulton-rotten-generators-0.4.0 rails_generators/rotten_layout/rotten_layout_generator.rb
PeterCoulton-rotten-generators-0.5.0 rails_generators/rotten_layout/rotten_layout_generator.rb
PeterCoulton-rotten-generators-0.5.1 rails_generators/rotten_layout/rotten_layout_generator.rb
PeterCoulton-rotten-generators-0.6.0 rails_generators/rotten_layout/rotten_layout_generator.rb
PeterCoulton-rotten-generators-0.7.0 rails_generators/rotten_layout/rotten_layout_generator.rb