Class: ShopQiAppGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ShopQiAppGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/shopqi_app/shopqi_app_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add_routes ⇒ Object
- #copy_files ⇒ Object
- #install_migration ⇒ Object
- #remove_files ⇒ Object
- #show ⇒ Object
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_routes ⇒ Object
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_files ⇒ Object
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_migration ⇒ Object
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_files ⇒ Object
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 |
#show ⇒ Object
32 33 34 |
# File 'lib/generators/shopqi_app/shopqi_app_generator.rb', line 32 def show readme "README" end |