Class: Spree::Auth::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/spree/auth/install/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_pathsObject



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.expand_path('../templates', __FILE__)
  paths.flatten
end

Instance Method Details

#add_javascriptsObject



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_migrationsObject



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_keyObject



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_migrationsObject



26
27
28
29
30
31
32
# File 'lib/generators/spree/auth/install/install_generator.rb', line 26

def run_migrations
 if options[:migrate]
   run 'bundle exec rake db:migrate VERBOSE=false'
 else
   puts "Skiping rake db:migrate, don't forget to run it!"
 end
end