Class: Spree::Auth::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Spree::Auth::Generators::InstallGenerator
- Defined in:
- lib/generators/spree/auth/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add_javascripts ⇒ Object
- #add_migrations ⇒ Object
- #generate_devise_key ⇒ Object
- #run_migrations ⇒ Object
Class Method Details
.source_paths ⇒ Object
7 8 9 10 11 |
# File 'lib/generators/spree/auth/install/install_generator.rb', line 7 def self.source_paths paths = superclass.source_paths paths << File.('../templates', __FILE__) paths.flatten end |
Instance Method Details
#add_javascripts ⇒ Object
13 14 15 |
# File 'lib/generators/spree/auth/install/install_generator.rb', line 13 def add_javascripts append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/spree_auth\n" end |
#add_migrations ⇒ Object
22 23 24 |
# File 'lib/generators/spree/auth/install/install_generator.rb', line 22 def add_migrations run 'bundle exec rake railties:install:migrations FROM=spree_auth' end |
#generate_devise_key ⇒ Object
17 18 19 20 |
# File 'lib/generators/spree/auth/install/install_generator.rb', line 17 def generate_devise_key return if ENV['CI'] template 'config/initializers/devise.rb', 'config/initializers/devise.rb' end |
#run_migrations ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/generators/spree/auth/install/install_generator.rb', line 26 def run_migrations if [:migrate] run 'bundle exec rake db:migrate VERBOSE=false' else puts "Skiping rake db:migrate, don't forget to run it!" end end |