Class: Cucumber::FeatureGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Cucumber::FeatureGenerator
show all
- Includes:
- Generators::FeatureBase
- Defined in:
- lib/generators/cucumber/feature/feature_generator.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#create_directory, #create_feature_file, #create_steps_file, #create_support_file
Instance Attribute Details
#named_args ⇒ Object
Returns the value of attribute named_args.
11
12
13
|
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 11
def named_args
@named_args
end
|
Class Method Details
.banner ⇒ Object
24
25
26
|
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 24
def self.banner
"#{$0} cucumber:feature ModelName [field:type, field:type]"
end
|
.gem_root ⇒ Object
28
29
30
|
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 28
def self.gem_root
File.expand_path("../../../../../", __FILE__)
end
|
.source_root ⇒ Object
32
33
34
|
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 32
def self.source_root
File.join(gem_root, 'templates', 'feature')
end
|
Instance Method Details
#generate ⇒ Object
17
18
19
20
21
22
|
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 17
def generate
create_directory
create_feature_file
create_steps_file
create_support_file
end
|
#parse_fields ⇒ Object
13
14
15
|
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 13
def parse_fields
@named_args = @fields.nil? ? [] : @fields.map { |arg| NamedArg.new(arg) }
end
|