Sha256: 1ba50074e63155ba6f26950b189eea33e93ee5bc34a98f12161010e4dcb1eb47

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 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_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/ie.sass",  "app/stylesheets/public/ie.sass"
      
      m.file     "sass/color.sass",  "app/stylesheets/sass/color.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

1 entries across 1 versions & 1 rubygems

Version Path
PeterCoulton-rotten-generators-0.0.3 rails_generators/rotten_layout/rotten_layout_generator.rb