Class: ExtensionMigrationGenerator
- Defined in:
- lib/generators/extension_migration/extension_migration_generator.rb
Instance Attribute Summary collapse
-
#extension_name ⇒ Object
Returns the value of attribute extension_name.
Instance Method Summary collapse
- #banner ⇒ Object
- #destination_root ⇒ Object
- #extension_path ⇒ Object
-
#initialize(runtime_args, runtime_options = {}) ⇒ ExtensionMigrationGenerator
constructor
A new instance of ExtensionMigrationGenerator.
Constructor Details
#initialize(runtime_args, runtime_options = {}) ⇒ ExtensionMigrationGenerator
Returns a new instance of ExtensionMigrationGenerator.
8 9 10 11 12 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 8 def initialize(runtime_args, = {}) runtime_args = runtime_args.dup @extension_name = runtime_args.shift super(runtime_args, ) end |
Instance Attribute Details
#extension_name ⇒ Object
Returns the value of attribute extension_name.
6 7 8 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 6 def extension_name @extension_name end |
Instance Method Details
#banner ⇒ Object
14 15 16 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 14 def "Usage: #{$0} extension_migration ExtensionName MigrationName [field:type, field:type]" end |
#destination_root ⇒ Object
22 23 24 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 22 def destination_root File.join(RAILS_ROOT, extension_path) end |
#extension_path ⇒ Object
18 19 20 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 18 def extension_path File.join('vendor', 'extensions', @extension_name.underscore) end |