Class: Chaskiq::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Chaskiq::Generators::InstallGenerator
- Defined in:
- lib/generators/chaskiq/install_generator.rb
Instance Method Summary collapse
- #copy_initializer ⇒ Object
-
#create_migrations ⇒ Object
def self.source_root File.expand_path(“../templates”, __FILE__) end.
- #setup_routes ⇒ Object
Instance Method Details
#copy_initializer ⇒ Object
11 12 13 14 |
# File 'lib/generators/chaskiq/install_generator.rb', line 11 def copy_initializer #@underscored_user_name = "user".underscore template '../templates/chaskiq.rb.erb', 'config/initializers/chaskiq.rb' end |
#create_migrations ⇒ Object
def self.source_root
File.("../templates", __FILE__)
end
24 25 26 27 28 29 30 31 |
# File 'lib/generators/chaskiq/install_generator.rb', line 24 def create_migrations exec 'bundle exec rake chaskiq:install:migrations' #Dir["#{self.class.source_root}/migrations/*.rb"].sort.each do |filepath| # name = File.basename(filepath) # template "migrations/#{name}", "db/migrate/#{name}" # sleep 1 #end end |
#setup_routes ⇒ Object
16 17 18 |
# File 'lib/generators/chaskiq/install_generator.rb', line 16 def setup_routes route "mount Chaskiq::Engine => '/'" end |