Class: ShopQiAppGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/shopqi_app/shopqi_app_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



36
37
38
# File 'lib/generators/shopqi_app/shopqi_app_generator.rb', line 36

def self.next_migration_number(dirname)
  ActiveRecord::Generators::Base.next_migration_number(dirname)
end

Instance Method Details

#add_routesObject



23
24
25
26
# File 'lib/generators/shopqi_app/shopqi_app_generator.rb', line 23

def add_routes
  route "use_shopqi"
  route "root :to => 'home#index'"
end

#copy_filesObject



11
12
13
14
# File 'lib/generators/shopqi_app/shopqi_app_generator.rb', line 11

def copy_files
  directory 'app'
  template 'config/app_secret_config.yml.erb', 'config/app_secret_config.yml'
end

#install_migrationObject



28
29
30
# File 'lib/generators/shopqi_app/shopqi_app_generator.rb', line 28

def install_migration
  migration_template 'db/migrate/create_shops.rb', 'db/migrate/create_shops.rb'
end

#remove_filesObject



16
17
18
19
20
21
# File 'lib/generators/shopqi_app/shopqi_app_generator.rb', line 16

def remove_files
  remove_file 'public/index.html'
  remove_file 'app/assets/javascripts/application.js'
  remove_file 'app/assets/stylesheets/application.css'
  remove_file 'app/views/layouts/application.html.erb'
end

#showObject



32
33
34
# File 'lib/generators/shopqi_app/shopqi_app_generator.rb', line 32

def show
  readme "README"
end