Class: ExtensionMigrationGenerator
- Inherits:
-
MigrationGenerator
- Object
- MigrationGenerator
- 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.
7 8 9 10 11 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 7 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.
5 6 7 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 5 def extension_name @extension_name end |
Instance Method Details
#banner ⇒ Object
13 14 15 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 13 def "Usage: #{$0} extension_migration ExtensionName MigrationName [field:type, field:type]" end |
#destination_root ⇒ Object
21 22 23 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 21 def destination_root File.join(Rails.root, extension_path) end |
#extension_path ⇒ Object
17 18 19 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 17 def extension_path File.join('vendor', 'extensions', @extension_name.underscore) end |