Class: SpreeMultiCurrency::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SpreeMultiCurrency::Generators::InstallGenerator
- Defined in:
- lib/generators/spree_multi_currency/install/install_generator.rb
Instance Method Summary collapse
- #add_javascripts ⇒ Object
- #add_migrations ⇒ Object
- #add_stylesheets ⇒ Object
- #run_migrations ⇒ Object
Instance Method Details
#add_javascripts ⇒ Object
7 8 9 10 11 12 |
# File 'lib/generators/spree_multi_currency/install/install_generator.rb', line 7 def add_javascripts append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_frontend\n" append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_backend\n" end |
#add_migrations ⇒ Object
25 26 27 |
# File 'lib/generators/spree_multi_currency/install/install_generator.rb', line 25 def add_migrations run 'bundle exec rake railties:install:migrations FROM=spree_multi_currency' end |
#add_stylesheets ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/generators/spree_multi_currency/install/install_generator.rb', line 14 def add_stylesheets inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_frontend\n", before: /\*\//, verbose: true inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_backend\n", before: /\*\//, verbose: true end |
#run_migrations ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/generators/spree_multi_currency/install/install_generator.rb', line 29 def run_migrations = 'Would you like to run the migrations now? [Y/n]' run_migrations = [:auto_run_migrations] || ['', 'y', 'Y'].include?(ask ) if run_migrations run 'bundle exec rake db:migrate' else puts 'Skipping rake db:migrate, don\'t forget to run it!' end end |