Class: ThemeGenerator
- Inherits:
-
Rails::Generator::Base
- Object
- Rails::Generator::Base
- ThemeGenerator
- Defined in:
- lib/vendor/plugins/web-app-theme/rails_generators/theme/theme_generator.rb
Instance Method Summary collapse
- #banner ⇒ Object
-
#initialize(runtime_args, runtime_options = {}) ⇒ ThemeGenerator
constructor
A new instance of ThemeGenerator.
- #manifest ⇒ Object
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, = {}) super @name = @args.first || 'application' end |
Instance Method Details
#banner ⇒ Object
23 24 25 |
# File 'lib/vendor/plugins/web-app-theme/rails_generators/theme/theme_generator.rb', line 23 def "Usage: #{$0} theme [layout_name] [options]" end |
#manifest ⇒ Object
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/#{[:theme]}/") m.template("view_layout_#{[:layout_type]}.html.erb", File.join("app/views/layouts", "#{@name}.html.erb")) unless [:no_layout] m.template("../../../stylesheets/base.css", File.join("public/stylesheets", "web_app_theme.css")) m.template("../../../stylesheets/themes/#{[:theme]}/style.css", File.join("public/stylesheets/themes/#{[:theme]}", "style.css")) end end |