Class: Panda::Core::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Panda::Core::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/panda/core/install_generator.rb
Class Method Summary collapse
-
.allow_incompatible_default_type! ⇒ Object
Allow incompatible default types for Thor options.
- .next_migration_number(dirname) ⇒ Object
Instance Method Summary collapse
Class Method Details
.allow_incompatible_default_type! ⇒ Object
Allow incompatible default types for Thor options
11 12 13 |
# File 'lib/generators/panda/core/install_generator.rb', line 11 def self.allow_incompatible_default_type! true end |
.next_migration_number(dirname) ⇒ Object
20 21 22 23 |
# File 'lib/generators/panda/core/install_generator.rb', line 20 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_initializer ⇒ Object
25 26 27 |
# File 'lib/generators/panda/core/install_generator.rb', line 25 def create_initializer template "initializer.rb", "config/initializers/panda.rb" end |
#mount_engine ⇒ Object
29 30 31 32 33 34 |
# File 'lib/generators/panda/core/install_generator.rb', line 29 def mount_engine routes_file = File.join(destination_root, "config/routes.rb") return unless File.exist?(routes_file) route 'mount Panda::Core::Engine => "/"' end |
#show_readme ⇒ Object
36 37 38 |
# File 'lib/generators/panda/core/install_generator.rb', line 36 def show_readme readme "README" if behavior == :invoke end |