Class: StyleGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- StyleGenerator
- Defined in:
- lib/generators/style/style_generator.rb
Instance Method Summary collapse
- #copy_doc_assets ⇒ Object
- #copy_markup_assets ⇒ Object
- #copy_route ⇒ Object
- #copy_template_files ⇒ Object
Instance Method Details
#copy_doc_assets ⇒ Object
11 12 13 |
# File 'lib/generators/style/style_generator.rb', line 11 def copy_doc_assets directory 'lib/assets/style_guide' end |
#copy_markup_assets ⇒ Object
15 16 17 |
# File 'lib/generators/style/style_generator.rb', line 15 def copy_markup_assets end |
#copy_route ⇒ Object
6 7 8 9 |
# File 'lib/generators/style/style_generator.rb', line 6 def copy_route insert_into_file "config/routes.rb", "\nget '/style_guide' => 'style_guide/style_guide#index'", after: "Rails.application.routes.draw do" end |
#copy_template_files ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/style/style_generator.rb', line 19 def copy_template_files copy_file "style_guide_controller.rb", "app/controllers/style_guide/style_guide_controller.rb" copy_file "style_guide_helper.rb", "app/helpers/style_guide/style_guide_helper.rb" copy_file "style_guide.html.erb", "app/views/layouts/style_guide/style_guide.html.erb" copy_file "index.html.erb", "app/views/style_guide/style_guide/index.html.erb" copy_file "style_guides_plugins.js", "app/assets/javascripts/style_guide/style_guides_plugins.js" copy_file "style_guides.js", "app/assets/javascripts/style_guide/style_guides.js" copy_file "style_guides.css", "app/assets/stylesheets/style_guide/style_guides.css" copy_file "style.css", "app/assets/stylesheets/style_guide/style.css" end |