Class: ExtensionMigrationGenerator
- Inherits:
-
Rails::Generator::NamedBase
- Object
- Rails::Generator::NamedBase
- ExtensionMigrationGenerator
- Defined in:
- lib/generators/extension_migration/extension_migration_generator.rb
Instance Attribute Summary collapse
-
#extension_file_name ⇒ Object
readonly
Returns the value of attribute extension_file_name.
-
#extension_path ⇒ Object
readonly
Returns the value of attribute extension_path.
Instance Method Summary collapse
-
#attributes ⇒ Object
overload the super method which was causing problems for some unknown reason (too lazy to debug properly).
- #banner ⇒ Object
-
#initialize(runtime_args, runtime_options = {}) ⇒ ExtensionMigrationGenerator
constructor
A new instance of ExtensionMigrationGenerator.
- #manifest ⇒ Object
Constructor Details
#initialize(runtime_args, runtime_options = {}) ⇒ ExtensionMigrationGenerator
Returns a new instance of ExtensionMigrationGenerator.
7 8 9 10 11 12 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 7 def initialize(runtime_args, = {}) super @extension_file_name = "#{file_name}_extension" @extension_path = "vendor/extensions/#{file_name}" @migration_name = runtime_args[1] end |
Instance Attribute Details
#extension_file_name ⇒ Object (readonly)
Returns the value of attribute extension_file_name.
5 6 7 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 5 def extension_file_name @extension_file_name end |
#extension_path ⇒ Object (readonly)
Returns the value of attribute extension_path.
5 6 7 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 5 def extension_path @extension_path end |
Instance Method Details
#attributes ⇒ Object
overload the super method which was causing problems for some unknown reason (too lazy to debug properly)
15 16 17 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 15 def attributes [] end |
#banner ⇒ Object
19 20 21 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 19 def "Usage: #{$0} extension_migration ExtensionName MigrationName [options]" end |
#manifest ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/generators/extension_migration/extension_migration_generator.rb', line 23 def manifest record do |m| m.migration_template 'migration.rb', "#{extension_path}/db/migrate", :assigns => {:migration_name => @migration_name}, :migration_file_name => @migration_name.underscore end end |