Class: CucumberRailsTrainingWheels::FeatureGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- CucumberRailsTrainingWheels::FeatureGenerator
- Defined in:
- lib/generators/cucumber_rails_training_wheels/feature/feature_generator.rb
Instance Attribute Summary collapse
-
#named_args ⇒ Object
readonly
Returns the value of attribute named_args.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#named_args ⇒ Object (readonly)
Returns the value of attribute named_args.
9 10 11 |
# File 'lib/generators/cucumber_rails_training_wheels/feature/feature_generator.rb', line 9 def named_args @named_args end |
Class Method Details
.banner ⇒ Object
23 24 25 |
# File 'lib/generators/cucumber_rails_training_wheels/feature/feature_generator.rb', line 23 def self. "#{$0} cucumber:feature ModelName [field:type, field:type]" end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/generators/cucumber_rails_training_wheels/feature/feature_generator.rb', line 15 def generate template 'feature.erb', "features/manage_#{plural_name}.feature" template 'steps.erb', "features/step_definitions/#{singular_name}_steps.rb" gsub_file 'features/support/paths.rb', /'\/'/mi do |match| "#{match}\n when /the new #{singular_name} page/\n new_#{singular_name}_path\n" end end |