Class: Bootsy::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Bootsy::Generators::InstallGenerator
- Defined in:
- lib/generators/bootsy/install_generator.rb
Overview
Public: A Rails Generator to copy translations, assets and routes to the host app.
Instance Method Summary collapse
- #add_javascript ⇒ Object
- #add_routes ⇒ Object
- #add_stylesheet ⇒ Object
- #copy_config ⇒ Object
- #copy_locale ⇒ Object
Instance Method Details
#add_javascript ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/generators/bootsy/install_generator.rb', line 17 def add_javascript require_asset( 'app/assets/javascripts/application.js', "\n//= require bootsy", '//= require jquery_ujs' ) end |
#add_routes ⇒ Object
8 9 10 |
# File 'lib/generators/bootsy/install_generator.rb', line 8 def add_routes route "mount Bootsy::Engine => '/bootsy', as: 'bootsy'" end |
#add_stylesheet ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/generators/bootsy/install_generator.rb', line 25 def add_stylesheet require_asset( 'app/assets/stylesheets/application.css', "\n *= require bootsy", '*= require_self' ) end |
#copy_config ⇒ Object
33 34 35 |
# File 'lib/generators/bootsy/install_generator.rb', line 33 def copy_config template 'bootsy.rb', 'config/initializers/bootsy.rb' end |
#copy_locale ⇒ Object
12 13 14 15 |
# File 'lib/generators/bootsy/install_generator.rb', line 12 def copy_locale copy_file '../../../../config/locales/bootsy.en.yml', 'config/locales/bootsy.en.yml' end |