Class: F7::Generators::LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- F7::Generators::LayoutGenerator
- Defined in:
- lib/generators/f7/layout/layout_generator.rb,
lib/generators/f7/install/examples/examples_generator.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#container_class ⇒ Object
readonly
Returns the value of attribute container_class.
Instance Method Summary collapse
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
10 11 12 |
# File 'lib/generators/f7/layout/layout_generator.rb', line 10 def app_name @app_name end |
#container_class ⇒ Object (readonly)
Returns the value of attribute container_class.
10 11 12 |
# File 'lib/generators/f7/layout/layout_generator.rb', line 10 def container_class @container_class end |
Instance Method Details
#generate_layout ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/generators/f7/layout/layout_generator.rb', line 12 def generate_layout app = ::Rails.application @app_name = app.class.to_s.split("::").first ext = :erb template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}" ext = use_coffeescript? ? :coffee : :js if layout_name.eql? 'application' template "setup.#{ext}", "app/assets/javascripts/setup.#{ext}" else touch "app/assets/javascripts/#{layout_name}.#{ext}" end end |