Class: Wheel::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/wheel/install/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



11
12
13
14
# File 'lib/generators/wheel/install/install_generator.rb', line 11

def self.next_migration_number(dirname)
  next_migration_number = current_migration_number(dirname) + 1
  ActiveRecord::Migration.next_migration_number(next_migration_number)
end

Instance Method Details

#create_initializerObject



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

def create_initializer
  template(
    'wheel.rb',
    'config/initializers/wheel.rb'
  )
end

#create_migration_fileObject



16
17
18
19
20
21
# File 'lib/generators/wheel/install/install_generator.rb', line 16

def create_migration_file
  migration_template(
    'create_wheel_configs.rb',
    'db/migrate/create_wheel_configs.rb'
  )
end

#mount_engineObject



23
24
25
# File 'lib/generators/wheel/install/install_generator.rb', line 23

def mount_engine
  route "mount Wheel::Engine => '/wheel'"
end