Class: Core::LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Core::LayoutGenerator
- Defined in:
- lib/generators/core/layout/layout_generator.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
Returns the value of attribute file_name.
Instance Method Summary collapse
- #copy_buttons ⇒ Object
- #copy_core_helper ⇒ Object
- #copy_layout_file ⇒ Object
- #copy_sidebar_file ⇒ Object
- #copy_static_files ⇒ Object
-
#initialize(*args, &block) ⇒ LayoutGenerator
constructor
A new instance of LayoutGenerator.
Constructor Details
#initialize(*args, &block) ⇒ LayoutGenerator
Returns a new instance of LayoutGenerator.
10 11 12 13 |
# File 'lib/generators/core/layout/layout_generator.rb', line 10 def initialize(*args, &block) super @file_name = name end |
Instance Attribute Details
#file_name ⇒ Object
Returns the value of attribute file_name.
4 5 6 |
# File 'lib/generators/core/layout/layout_generator.rb', line 4 def file_name @file_name end |
Instance Method Details
#copy_buttons ⇒ Object
27 28 29 |
# File 'lib/generators/core/layout/layout_generator.rb', line 27 def directory "images", "public/images" end |
#copy_core_helper ⇒ Object
23 24 25 |
# File 'lib/generators/core/layout/layout_generator.rb', line 23 def copy_core_helper template 'core_helper.rb', File.join('app/helpers', "core_helper.rb") end |
#copy_layout_file ⇒ Object
15 16 17 |
# File 'lib/generators/core/layout/layout_generator.rb', line 15 def copy_layout_file template "views/#{view_language}/layout.html.#{view_language}", "app/views/layouts/#{name}.html.#{view_language}" end |
#copy_sidebar_file ⇒ Object
19 20 21 |
# File 'lib/generators/core/layout/layout_generator.rb', line 19 def template "views/#{view_language}/_sidebar.html.#{view_language}", "app/views/shared/_sidebar.html.#{view_language}" end |
#copy_static_files ⇒ Object
31 32 33 34 |
# File 'lib/generators/core/layout/layout_generator.rb', line 31 def copy_static_files directory "stylesheets", "app/stylesheets/#{file_name}" copy_file 'core.js', "public/javascripts/core.js" end |