Class: ThemeGenerator

Inherits:
Rails::Generator::Base
  • Object
show all
Defined in:
lib/vendor/plugins/web-app-theme/rails_generators/theme/theme_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(runtime_args, runtime_options = {}) ⇒ ThemeGenerator

Returns a new instance of ThemeGenerator.



8
9
10
11
# File 'lib/vendor/plugins/web-app-theme/rails_generators/theme/theme_generator.rb', line 8

def initialize(runtime_args, runtime_options = {})
  super
  @name = @args.first || 'application'
end

Instance Method Details



23
24
25
# File 'lib/vendor/plugins/web-app-theme/rails_generators/theme/theme_generator.rb', line 23

def banner
  "Usage: #{$0} theme [layout_name] [options]"
end

#manifestObject



13
14
15
16
17
18
19
20
21
# File 'lib/vendor/plugins/web-app-theme/rails_generators/theme/theme_generator.rb', line 13

def manifest
  record do |m|            
    m.directory("app/views/layouts")
    m.directory("public/stylesheets/themes/#{options[:theme]}/")      
    m.template("view_layout_#{options[:layout_type]}.html.erb", File.join("app/views/layouts", "#{@name}.html.erb")) unless options[:no_layout]
    m.template("../../../stylesheets/base.css",  File.join("public/stylesheets", "web_app_theme.css"))
    m.template("../../../stylesheets/themes/#{options[:theme]}/style.css",  File.join("public/stylesheets/themes/#{options[:theme]}", "style.css"))      
  end
end