Class: SpreeFosdickIntegration::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SpreeFosdickIntegration::Generators::InstallGenerator
- Defined in:
- lib/generators/spree_fosdick_integration/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_paths ⇒ Object
7 8 9 10 11 |
# File 'lib/generators/spree_fosdick_integration/install/install_generator.rb', line 7 def self.source_paths paths = self.superclass.source_paths paths << File.('../templates', __FILE__) paths.flatten end |
Instance Method Details
#add_migrations ⇒ Object
13 14 15 |
# File 'lib/generators/spree_fosdick_integration/install/install_generator.rb', line 13 def add_migrations run 'bundle exec rake railties:install:migrations FROM=spree_fosdick_integration' end |
#copy_initializer ⇒ Object
26 27 28 29 |
# File 'lib/generators/spree_fosdick_integration/install/install_generator.rb', line 26 def copy_initializer copy_file 'fosdick.yml.template', 'config/fosdick.yml' copy_file 'fosdick.rb', 'config/initializers/fosdick.rb' end |
#run_migrations ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/generators/spree_fosdick_integration/install/install_generator.rb', line 17 def run_migrations run_migrations = [:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]') if run_migrations run 'bundle exec rake db:migrate' else puts 'Skipping rake db:migrate, don\'t forget to run it!' end end |