cucumber-in-the-yard 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/History.txt +24 -0
  2. data/Manifest +54 -41
  3. data/README.md +45 -1
  4. data/Rakefile +4 -3
  5. data/cucumber-in-the-yard.gemspec +5 -5
  6. data/example/{example.step.rb → step_definitions/example.step.rb} +0 -0
  7. data/example/step_definitions/support/env.rb +0 -0
  8. data/example/step_definitions/support/env_support.rb +0 -0
  9. data/example/step_definitions/support/support.rb +0 -0
  10. data/features/definitions/city_step.rb +89 -0
  11. data/features/definitions/test.setup.and.teardown.rb +27 -0
  12. data/features/features.feature +44 -0
  13. data/lib/city.rb +20 -11
  14. data/lib/cucumber/city_builder.rb +60 -55
  15. data/lib/templates/default/feature/html/background.erb +92 -0
  16. data/lib/templates/default/feature/html/feature.erb +22 -0
  17. data/lib/templates/default/feature/html/no_steps_defined.erb +1 -0
  18. data/lib/templates/default/feature/html/outline.erb +19 -0
  19. data/lib/templates/default/feature/html/pystring.erb +3 -0
  20. data/lib/templates/default/feature/html/scenario.erb +43 -0
  21. data/lib/templates/default/feature/html/steps.erb +34 -0
  22. data/lib/templates/default/feature/html/table.erb +20 -0
  23. data/lib/templates/default/feature/setup.rb +28 -0
  24. data/lib/{yard/templates → templates}/default/fulldoc/html/css/common.css +0 -0
  25. data/lib/{yard/templates → templates}/default/fulldoc/html/full_list.erb +0 -0
  26. data/lib/templates/default/fulldoc/html/full_list_features.erb +7 -0
  27. data/lib/templates/default/fulldoc/html/full_list_requirements.erb +1 -0
  28. data/lib/templates/default/fulldoc/html/full_list_scenarios.erb +8 -0
  29. data/lib/{yard/templates → templates}/default/fulldoc/html/full_list_stepdefinitions.erb +2 -2
  30. data/lib/{yard/templates → templates}/default/fulldoc/html/full_list_steps.erb +0 -0
  31. data/lib/templates/default/fulldoc/html/full_list_tags.erb +8 -0
  32. data/lib/{yard/templates → templates}/default/fulldoc/html/index.erb +0 -0
  33. data/lib/{yard/templates → templates}/default/fulldoc/html/js/cucumber.js +1 -1
  34. data/lib/templates/default/fulldoc/html/setup.rb +56 -0
  35. data/lib/{yard/templates → templates}/default/layout/html/headers.erb +0 -0
  36. data/lib/{yard/templates → templates}/default/layout/html/search.erb +0 -0
  37. data/lib/{yard/templates → templates}/default/scenario/html/scenario.erb +0 -0
  38. data/lib/{yard/templates → templates}/default/scenario/setup.rb +0 -0
  39. data/lib/templates/default/steptransformers/html/stepdefinition.erb +38 -0
  40. data/lib/templates/default/steptransformers/html/steptransformers.erb +7 -0
  41. data/lib/templates/default/steptransformers/setup.rb +17 -0
  42. data/lib/templates/default/tag/html/feature.erb +23 -0
  43. data/lib/templates/default/tag/html/scenario.erb +21 -0
  44. data/lib/templates/default/tag/html/tag.erb +18 -0
  45. data/lib/templates/default/tag/setup.rb +5 -0
  46. data/lib/yard/code_objects/{base.rb → cucumber/base.rb} +3 -9
  47. data/lib/yard/code_objects/{feature.rb → cucumber/feature.rb} +1 -1
  48. data/lib/yard/code_objects/cucumber/namespace_object.rb +18 -0
  49. data/lib/yard/code_objects/{scenario.rb → cucumber/scenario.rb} +1 -1
  50. data/lib/yard/code_objects/{step.rb → cucumber/step.rb} +0 -0
  51. data/lib/yard/code_objects/cucumber/tag.rb +27 -0
  52. data/lib/yard/{extensions.rb → code_objects/namespace_object.rb} +11 -2
  53. data/lib/yard/code_objects/step_definition.rb +38 -0
  54. data/lib/yard/code_objects/step_transform.rb +14 -0
  55. data/lib/yard/handlers/{base.rb → cucumber/base.rb} +0 -0
  56. data/lib/yard/handlers/{feature_handler.rb → cucumber/feature_handler.rb} +3 -2
  57. data/lib/yard/handlers/step_definition_handler.rb +57 -0
  58. data/lib/yard/handlers/step_transform_handler.rb +21 -0
  59. data/lib/yard/parser/{feature.rb → cucumber/feature.rb} +0 -0
  60. data/lib/yard/parser/source_parser.rb +54 -0
  61. data/lib/yard/rake/city_task.rb +1 -1
  62. data/lib/yard/templates/helpers/base_helper.rb +20 -0
  63. metadata +105 -77
  64. data/lib/yard/code_objects/tags.rb +0 -55
  65. data/lib/yard/rb_extensions.rb +0 -156
  66. data/lib/yard/templates/default/feature/html/feature.erb +0 -245
  67. data/lib/yard/templates/default/feature/setup.rb +0 -5
  68. data/lib/yard/templates/default/fulldoc/html/full_list_features.erb +0 -10
  69. data/lib/yard/templates/default/fulldoc/html/full_list_scenarios.erb +0 -10
  70. data/lib/yard/templates/default/fulldoc/html/full_list_tagusages.erb +0 -10
  71. data/lib/yard/templates/default/fulldoc/html/setup.rb +0 -73
  72. data/lib/yard/templates/default/module/html/step_transforms.erb +0 -23
  73. data/lib/yard/templates/default/module/setup.rb +0 -5
  74. data/lib/yard/templates/default/steptransformers/html/stepdefinition.erb +0 -50
  75. data/lib/yard/templates/default/steptransformers/setup.rb +0 -5
  76. data/lib/yard/templates/default/tagusage/html/tagusage.erb +0 -65
  77. data/lib/yard/templates/default/tagusage/setup.rb +0 -5
  78. data/spec/city/feature_parser_spec_examples.rb +0 -153
  79. data/spec/city/gherkin_loader_spec.rb +0 -39
  80. data/spec/city/test.feature +0 -36
  81. data/spec/city/yard_handlers_cucumber_spec.rb +0 -24
  82. data/spec/city/yard_namespace_object_spec.rb +0 -8
  83. data/spec/city/yard_parser_cucumber_spec.rb +0 -215
  84. data/spec/city/yard_rb_extensions_spec.rb +0 -128
  85. data/spec/spec_helper.rb +0 -5
File without changes
@@ -26,7 +26,8 @@ module YARD
26
26
  def process_scenario(scenario)
27
27
 
28
28
  scenario.steps.each do |step|
29
- owner.step_definitions.each do |stepdef|
29
+ YARD::Registry.all(:stepdefinition).each do |stepdef|
30
+ #log.debug "Looking at step #{step} against #{stepdef}"
30
31
 
31
32
  if stepdef.compare_value =~ /.+\#\{[^\}]+\}.+/
32
33
  #log.debug "Step definition has packed constant #{stepdef.compare_value}"
@@ -34,7 +35,7 @@ module YARD
34
35
  if %r{#{stepdef.compare_value}}.match(step.value)
35
36
  step.definition = stepdef
36
37
  stepdef.steps << step
37
- log.debug "STEP #{step} has found its definition #{stepdef}"
38
+ #log.debug "STEP #{step} has found its definition #{stepdef}"
38
39
  break
39
40
  end
40
41
  end
@@ -0,0 +1,57 @@
1
+
2
+
3
+ class StepDefinitionHandler < YARD::Handlers::Ruby::Legacy::Base
4
+ MATCH = /^((When|Given|And|Then)\s*(\/[^\/]+\/).+)$/
5
+ handles MATCH
6
+
7
+ @@unique_name = 0
8
+
9
+ def process
10
+ keyword = statement.tokens.to_s[MATCH,2]
11
+ step_definition = statement.tokens.to_s[MATCH,3]
12
+
13
+ @@unique_name = @@unique_name + 1
14
+
15
+ stepdef_instance = StepDefinitionObject.new(YARD::CodeObjects::Cucumber::CUCUMBER_STEPTRANSFORM_NAMESPACE, "definition_#{@@unique_name}") do |o|
16
+ o.source = "#{keyword} #{step_definition} do #{statement.block.to_s =~ /^\s*\|.+/ ? '' : "\n "}#{statement.block.to_s}\nend"
17
+ o.value = step_definition
18
+ o.keyword = keyword
19
+ end
20
+
21
+ begin
22
+ # Look for all constants within the step definitions
23
+ stepdef_instance.constants = stepdef_instance._value_constants.each do |stepdef_constant|
24
+ owner.constants.each do |constant|
25
+ if stepdef_constant.to_sym == constant.name
26
+ #log.debug "Replacing #{constant.name} with its value in the step definition #{stepdef_instance.value}"
27
+ stepdef_instance.constants[constant.name] = unpack_constants(constant.value)
28
+ end
29
+ end
30
+ end
31
+
32
+ rescue Exception => e
33
+ log.error "Failed to link step definition to constants. This will make step definition to step linking impossible if constants are present. #{e}"
34
+ end
35
+
36
+
37
+ obj = register stepdef_instance
38
+
39
+
40
+ parse_block :owner => obj
41
+ rescue YARD::Handlers::NamespaceMissingError
42
+ end
43
+
44
+
45
+ def unpack_constants(constant_value)
46
+ constant_value.scan(/\#\{([^\}]+)\}/).flatten.collect { |value| value.strip }.each do |inner_constant|
47
+ inner_constant_match = owner.constants.find {|constant| constant.name.to_s == inner_constant }
48
+ if inner_constant_match
49
+ constant_value.gsub!(/\#\{#{inner_constant}\}/,unpack_constants(inner_constant_match.value))
50
+ end
51
+ end
52
+
53
+ constant_value.gsub!(/^('|"|\/)|('|"|\/)$/,'')
54
+ constant_value
55
+ end
56
+
57
+ end
@@ -0,0 +1,21 @@
1
+
2
+ class StepTransformHandler < YARD::Handlers::Ruby::Legacy::Base
3
+ MATCH = /^Transform\s*(\/[^\/]+\/).+$/
4
+ handles MATCH
5
+
6
+ @@unique_name = 0
7
+
8
+ def process
9
+ transform = statement.tokens.to_s[MATCH,1]
10
+
11
+ obj = register StepTransformObject.new(YARD::CodeObjects::Cucumber::CUCUMBER_STEPTRANSFORM_NAMESPACE, "transform_#{@@unique_name}") do |o|
12
+ o.source = "Transform #{transform} do #{statement.block.to_s}\nend"
13
+ o.source = statement.block.to_s
14
+ o.value = transform
15
+ end
16
+
17
+ parse_block :owner => obj
18
+
19
+ rescue YARD::Handlers::NamespaceMissingError
20
+ end
21
+ end
File without changes
@@ -0,0 +1,54 @@
1
+ module YARD::Parser
2
+
3
+ class SourceParser
4
+ class << self
5
+
6
+ #
7
+ # Following the conventions of ordering as Cucumber performs it
8
+ #
9
+ # environment files - 'directory/support/env.rb,env_*.rb'
10
+ # support files - 'directory/support/*.rb' (but not env prefixed)
11
+ # directory files - 'directory/*.rb'
12
+ #
13
+ # feature files - 'directory/*.feature'
14
+ #
15
+ def order_by_cucumber_standards(*files)
16
+
17
+ non_feature_files = files.reject {|x| x =~ /^.+\.feature$/}
18
+ feature_files = files.find_all {|x| x =~ /^.+\.feature$/ }
19
+
20
+ support_files = non_feature_files.find_all {|file| file =~ /support\/.+\.rb$/ }
21
+ other_files = non_feature_files - support_files
22
+
23
+ environment_files = support_files.find_all {|file| file =~ /support\/env.*\.rb$/ }
24
+ environment_files.sort_by {|x| x.length if x }
25
+
26
+ support_files = support_files - environment_files
27
+
28
+ environment_files + support_files + other_files + feature_files
29
+ end
30
+
31
+ def parse_in_order(*files)
32
+
33
+ files = order_by_cucumber_standards(*files)
34
+
35
+ while file = files.shift
36
+ begin
37
+ if file.is_a?(Array) && file.last.is_a?(Continuation)
38
+ log.debug("Re-processing #{file.first}")
39
+ file.last.call
40
+ elsif file.is_a?(String)
41
+ log.debug("Processing #{file}...")
42
+ new(parser_type, true).parse(file)
43
+ end
44
+ rescue LoadOrderError => e
45
+ # Out of order file. Push the context to the end and we'll call it
46
+ files.push([file, e.message])
47
+ end
48
+ end
49
+ end
50
+
51
+ end
52
+ end
53
+
54
+ end
@@ -4,7 +4,7 @@ module YARD::Rake
4
4
 
5
5
  def initialize(name = :yard)
6
6
  super
7
- self.options += [ "-e", "#{ File.dirname(__FILE__)}/../../city.rb", "-p", "#{File.dirname(__FILE__)}/../templates" ]
7
+ self.options += [ "-e", "#{ File.dirname(__FILE__)}/../../city.rb", "-p", "#{File.dirname(__FILE__)}/../../templates" ]
8
8
  end
9
9
 
10
10
  end
@@ -0,0 +1,20 @@
1
+ module YARD::Templates::Helpers
2
+
3
+ module BaseHelper
4
+
5
+ def format_object_title(object)
6
+ if object.is_a?(YARD::CodeObjects::Cucumber::NamespaceObject)
7
+ "#{format_object_type(object)}#{object.value ? ": #{object.value}" : ''}"
8
+ else
9
+ case object
10
+ when YARD::CodeObjects::RootObject
11
+ "Top Level Namespace"
12
+ else
13
+ format_object_type(object) + ": " + object.path
14
+ end
15
+ end
16
+ end
17
+
18
+ end
19
+
20
+ end
metadata CHANGED
@@ -4,16 +4,16 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 3
8
- version: "1.3"
7
+ - 4
8
+ version: "1.4"
9
9
  platform: ruby
10
10
  authors:
11
- - Frank;lin Webber
11
+ - Franklin Webber
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2010-10-13 00:00:00 -07:00
16
+ date: 2010-10-17 00:00:00 -07:00
17
17
  default_executable:
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
@@ -54,39 +54,54 @@ extra_rdoc_files:
54
54
  - README.md
55
55
  - lib/city.rb
56
56
  - lib/cucumber/city_builder.rb
57
- - lib/yard/code_objects/base.rb
58
- - lib/yard/code_objects/feature.rb
59
- - lib/yard/code_objects/scenario.rb
60
- - lib/yard/code_objects/step.rb
61
- - lib/yard/code_objects/tags.rb
62
- - lib/yard/extensions.rb
63
- - lib/yard/handlers/base.rb
64
- - lib/yard/handlers/feature_handler.rb
65
- - lib/yard/parser/feature.rb
57
+ - lib/templates/default/feature/html/background.erb
58
+ - lib/templates/default/feature/html/feature.erb
59
+ - lib/templates/default/feature/html/no_steps_defined.erb
60
+ - lib/templates/default/feature/html/outline.erb
61
+ - lib/templates/default/feature/html/pystring.erb
62
+ - lib/templates/default/feature/html/scenario.erb
63
+ - lib/templates/default/feature/html/steps.erb
64
+ - lib/templates/default/feature/html/table.erb
65
+ - lib/templates/default/feature/setup.rb
66
+ - lib/templates/default/fulldoc/html/css/common.css
67
+ - lib/templates/default/fulldoc/html/full_list.erb
68
+ - lib/templates/default/fulldoc/html/full_list_features.erb
69
+ - lib/templates/default/fulldoc/html/full_list_requirements.erb
70
+ - lib/templates/default/fulldoc/html/full_list_scenarios.erb
71
+ - lib/templates/default/fulldoc/html/full_list_stepdefinitions.erb
72
+ - lib/templates/default/fulldoc/html/full_list_steps.erb
73
+ - lib/templates/default/fulldoc/html/full_list_tags.erb
74
+ - lib/templates/default/fulldoc/html/index.erb
75
+ - lib/templates/default/fulldoc/html/js/cucumber.js
76
+ - lib/templates/default/fulldoc/html/setup.rb
77
+ - lib/templates/default/layout/html/headers.erb
78
+ - lib/templates/default/layout/html/search.erb
79
+ - lib/templates/default/scenario/html/scenario.erb
80
+ - lib/templates/default/scenario/setup.rb
81
+ - lib/templates/default/steptransformers/html/stepdefinition.erb
82
+ - lib/templates/default/steptransformers/html/steptransformers.erb
83
+ - lib/templates/default/steptransformers/setup.rb
84
+ - lib/templates/default/tag/html/feature.erb
85
+ - lib/templates/default/tag/html/scenario.erb
86
+ - lib/templates/default/tag/html/tag.erb
87
+ - lib/templates/default/tag/setup.rb
88
+ - lib/yard/code_objects/cucumber/base.rb
89
+ - lib/yard/code_objects/cucumber/feature.rb
90
+ - lib/yard/code_objects/cucumber/namespace_object.rb
91
+ - lib/yard/code_objects/cucumber/scenario.rb
92
+ - lib/yard/code_objects/cucumber/step.rb
93
+ - lib/yard/code_objects/cucumber/tag.rb
94
+ - lib/yard/code_objects/namespace_object.rb
95
+ - lib/yard/code_objects/step_definition.rb
96
+ - lib/yard/code_objects/step_transform.rb
97
+ - lib/yard/handlers/cucumber/base.rb
98
+ - lib/yard/handlers/cucumber/feature_handler.rb
99
+ - lib/yard/handlers/step_definition_handler.rb
100
+ - lib/yard/handlers/step_transform_handler.rb
101
+ - lib/yard/parser/cucumber/feature.rb
102
+ - lib/yard/parser/source_parser.rb
66
103
  - lib/yard/rake/city_task.rb
67
- - lib/yard/rb_extensions.rb
68
- - lib/yard/templates/default/feature/html/feature.erb
69
- - lib/yard/templates/default/feature/setup.rb
70
- - lib/yard/templates/default/fulldoc/html/css/common.css
71
- - lib/yard/templates/default/fulldoc/html/full_list.erb
72
- - lib/yard/templates/default/fulldoc/html/full_list_features.erb
73
- - lib/yard/templates/default/fulldoc/html/full_list_scenarios.erb
74
- - lib/yard/templates/default/fulldoc/html/full_list_stepdefinitions.erb
75
- - lib/yard/templates/default/fulldoc/html/full_list_steps.erb
76
- - lib/yard/templates/default/fulldoc/html/full_list_tagusages.erb
77
- - lib/yard/templates/default/fulldoc/html/index.erb
78
- - lib/yard/templates/default/fulldoc/html/js/cucumber.js
79
- - lib/yard/templates/default/fulldoc/html/setup.rb
80
- - lib/yard/templates/default/layout/html/headers.erb
81
- - lib/yard/templates/default/layout/html/search.erb
82
- - lib/yard/templates/default/module/html/step_transforms.erb
83
- - lib/yard/templates/default/module/setup.rb
84
- - lib/yard/templates/default/scenario/html/scenario.erb
85
- - lib/yard/templates/default/scenario/setup.rb
86
- - lib/yard/templates/default/steptransformers/html/stepdefinition.erb
87
- - lib/yard/templates/default/steptransformers/setup.rb
88
- - lib/yard/templates/default/tagusage/html/tagusage.erb
89
- - lib/yard/templates/default/tagusage/setup.rb
104
+ - lib/yard/templates/helpers/base_helper.rb
90
105
  files:
91
106
  - History.txt
92
107
  - Manifest
@@ -94,52 +109,65 @@ files:
94
109
  - Rakefile
95
110
  - example/empty.feature
96
111
  - example/example.feature
97
- - example/example.step.rb
98
112
  - example/example.third.feature
99
113
  - example/second_example.feature
114
+ - example/step_definitions/example.step.rb
115
+ - example/step_definitions/support/env.rb
116
+ - example/step_definitions/support/env_support.rb
117
+ - example/step_definitions/support/support.rb
118
+ - features/definitions/city_step.rb
119
+ - features/definitions/test.setup.and.teardown.rb
120
+ - features/features.feature
100
121
  - lib/city.rb
101
122
  - lib/cucumber/city_builder.rb
102
- - lib/yard/code_objects/base.rb
103
- - lib/yard/code_objects/feature.rb
104
- - lib/yard/code_objects/scenario.rb
105
- - lib/yard/code_objects/step.rb
106
- - lib/yard/code_objects/tags.rb
107
- - lib/yard/extensions.rb
108
- - lib/yard/handlers/base.rb
109
- - lib/yard/handlers/feature_handler.rb
110
- - lib/yard/parser/feature.rb
123
+ - lib/templates/default/feature/html/background.erb
124
+ - lib/templates/default/feature/html/feature.erb
125
+ - lib/templates/default/feature/html/no_steps_defined.erb
126
+ - lib/templates/default/feature/html/outline.erb
127
+ - lib/templates/default/feature/html/pystring.erb
128
+ - lib/templates/default/feature/html/scenario.erb
129
+ - lib/templates/default/feature/html/steps.erb
130
+ - lib/templates/default/feature/html/table.erb
131
+ - lib/templates/default/feature/setup.rb
132
+ - lib/templates/default/fulldoc/html/css/common.css
133
+ - lib/templates/default/fulldoc/html/full_list.erb
134
+ - lib/templates/default/fulldoc/html/full_list_features.erb
135
+ - lib/templates/default/fulldoc/html/full_list_requirements.erb
136
+ - lib/templates/default/fulldoc/html/full_list_scenarios.erb
137
+ - lib/templates/default/fulldoc/html/full_list_stepdefinitions.erb
138
+ - lib/templates/default/fulldoc/html/full_list_steps.erb
139
+ - lib/templates/default/fulldoc/html/full_list_tags.erb
140
+ - lib/templates/default/fulldoc/html/index.erb
141
+ - lib/templates/default/fulldoc/html/js/cucumber.js
142
+ - lib/templates/default/fulldoc/html/setup.rb
143
+ - lib/templates/default/layout/html/headers.erb
144
+ - lib/templates/default/layout/html/search.erb
145
+ - lib/templates/default/scenario/html/scenario.erb
146
+ - lib/templates/default/scenario/setup.rb
147
+ - lib/templates/default/steptransformers/html/stepdefinition.erb
148
+ - lib/templates/default/steptransformers/html/steptransformers.erb
149
+ - lib/templates/default/steptransformers/setup.rb
150
+ - lib/templates/default/tag/html/feature.erb
151
+ - lib/templates/default/tag/html/scenario.erb
152
+ - lib/templates/default/tag/html/tag.erb
153
+ - lib/templates/default/tag/setup.rb
154
+ - lib/yard/code_objects/cucumber/base.rb
155
+ - lib/yard/code_objects/cucumber/feature.rb
156
+ - lib/yard/code_objects/cucumber/namespace_object.rb
157
+ - lib/yard/code_objects/cucumber/scenario.rb
158
+ - lib/yard/code_objects/cucumber/step.rb
159
+ - lib/yard/code_objects/cucumber/tag.rb
160
+ - lib/yard/code_objects/namespace_object.rb
161
+ - lib/yard/code_objects/step_definition.rb
162
+ - lib/yard/code_objects/step_transform.rb
163
+ - lib/yard/handlers/cucumber/base.rb
164
+ - lib/yard/handlers/cucumber/feature_handler.rb
165
+ - lib/yard/handlers/step_definition_handler.rb
166
+ - lib/yard/handlers/step_transform_handler.rb
167
+ - lib/yard/parser/cucumber/feature.rb
168
+ - lib/yard/parser/source_parser.rb
111
169
  - lib/yard/rake/city_task.rb
112
- - lib/yard/rb_extensions.rb
113
- - lib/yard/templates/default/feature/html/feature.erb
114
- - lib/yard/templates/default/feature/setup.rb
115
- - lib/yard/templates/default/fulldoc/html/css/common.css
116
- - lib/yard/templates/default/fulldoc/html/full_list.erb
117
- - lib/yard/templates/default/fulldoc/html/full_list_features.erb
118
- - lib/yard/templates/default/fulldoc/html/full_list_scenarios.erb
119
- - lib/yard/templates/default/fulldoc/html/full_list_stepdefinitions.erb
120
- - lib/yard/templates/default/fulldoc/html/full_list_steps.erb
121
- - lib/yard/templates/default/fulldoc/html/full_list_tagusages.erb
122
- - lib/yard/templates/default/fulldoc/html/index.erb
123
- - lib/yard/templates/default/fulldoc/html/js/cucumber.js
124
- - lib/yard/templates/default/fulldoc/html/setup.rb
125
- - lib/yard/templates/default/layout/html/headers.erb
126
- - lib/yard/templates/default/layout/html/search.erb
127
- - lib/yard/templates/default/module/html/step_transforms.erb
128
- - lib/yard/templates/default/module/setup.rb
129
- - lib/yard/templates/default/scenario/html/scenario.erb
130
- - lib/yard/templates/default/scenario/setup.rb
131
- - lib/yard/templates/default/steptransformers/html/stepdefinition.erb
132
- - lib/yard/templates/default/steptransformers/setup.rb
133
- - lib/yard/templates/default/tagusage/html/tagusage.erb
134
- - lib/yard/templates/default/tagusage/setup.rb
135
- - spec/city/feature_parser_spec_examples.rb
136
- - spec/city/gherkin_loader_spec.rb
137
- - spec/city/test.feature
138
- - spec/city/yard_handlers_cucumber_spec.rb
139
- - spec/city/yard_namespace_object_spec.rb
140
- - spec/city/yard_parser_cucumber_spec.rb
141
- - spec/city/yard_rb_extensions_spec.rb
142
- - spec/spec_helper.rb
170
+ - lib/yard/templates/helpers/base_helper.rb
143
171
  - cucumber-in-the-yard.gemspec
144
172
  has_rdoc: true
145
173
  homepage: http://github.com/burtlo/Cucumber-In-The-Yard
@@ -1,55 +0,0 @@
1
-
2
-
3
- module YARD::CodeObjects::Cucumber
4
-
5
- class Tag < Base
6
-
7
- attr_accessor :value, :feature, :scenario
8
-
9
- end
10
-
11
-
12
- class TagUsage < Base
13
-
14
- attr_reader :value
15
-
16
- attr_accessor :tags
17
-
18
-
19
- def push(tag)
20
- @tags = [] unless @tags
21
- @tags << tag
22
-
23
- if tag.scenario
24
- @scenario_count = 0 unless @scenario_count
25
- @scenario_count += 1
26
- else
27
- @feature_count = 0 unless @feature_count
28
- @indirect_scenario_count = 0 unless @indirect_scenario_count
29
- @feature_count += 1
30
- @indirect_scenario_count += tag.feature.scenarios.length
31
- end
32
-
33
- end
34
-
35
- def scenario_count
36
- @scenario_count || 0
37
- end
38
-
39
- def feature_count
40
- @feature_count || 0
41
- end
42
-
43
- def indirect_scenario_count
44
- @indirect_scenario_count || 0
45
- end
46
-
47
- def total_scenario_count
48
- scenario_count + indirect_scenario_count
49
- end
50
-
51
- alias_method :<<, :push
52
-
53
- end
54
-
55
- end