yard-nrser-cucumber 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +61 -0
  3. data/.rspec +3 -0
  4. data/.yardopts +2 -0
  5. data/Gemfile +6 -0
  6. data/History.txt +288 -0
  7. data/LICENSE.txt +22 -0
  8. data/NAME +1 -0
  9. data/README.md +198 -0
  10. data/Rakefile +27 -0
  11. data/VERSION +1 -0
  12. data/example/README.md +8 -0
  13. data/example/child_feature/README.md +21 -0
  14. data/example/child_feature/child.feature +11 -0
  15. data/example/child_feature/grandchild_feature/grandchild.feature +12 -0
  16. data/example/empty.feature +2 -0
  17. data/example/french.feature +18 -0
  18. data/example/scenario.feature +63 -0
  19. data/example/scenario_outline.feature +100 -0
  20. data/example/scenario_outline_multi.feature +15 -0
  21. data/example/step_definitions/example.step.rb +122 -0
  22. data/example/step_definitions/first.step.rb +21 -0
  23. data/example/step_definitions/french_steps.rb +32 -0
  24. data/example/step_definitions/struct.rb +11 -0
  25. data/example/step_definitions/support/env.rb +7 -0
  26. data/example/step_definitions/support/env_support.rb +12 -0
  27. data/example/step_definitions/support/support.rb +6 -0
  28. data/example/tags.feature +18 -0
  29. data/example/transform.feature +18 -0
  30. data/lib/cucumber/city_builder.rb +412 -0
  31. data/lib/docserver/default/fulldoc/html/js/cucumber.js +85 -0
  32. data/lib/docserver/default/layout/html/headers.erb +13 -0
  33. data/lib/docserver/doc_server/full_list/html/full_list.erb +39 -0
  34. data/lib/docserver/doc_server/full_list/html/setup.rb +18 -0
  35. data/lib/templates/default/feature/html/feature.erb +39 -0
  36. data/lib/templates/default/feature/html/no_steps_defined.erb +1 -0
  37. data/lib/templates/default/feature/html/outline.erb +56 -0
  38. data/lib/templates/default/feature/html/pystring.erb +3 -0
  39. data/lib/templates/default/feature/html/scenario.erb +57 -0
  40. data/lib/templates/default/feature/html/setup.rb +51 -0
  41. data/lib/templates/default/feature/html/steps.erb +39 -0
  42. data/lib/templates/default/feature/html/table.erb +20 -0
  43. data/lib/templates/default/featuredirectory/html/alpha_table.erb +30 -0
  44. data/lib/templates/default/featuredirectory/html/directory.erb +32 -0
  45. data/lib/templates/default/featuredirectory/html/setup.rb +37 -0
  46. data/lib/templates/default/featuretags/html/namespace.erb +159 -0
  47. data/lib/templates/default/featuretags/html/setup.rb +34 -0
  48. data/lib/templates/default/fulldoc/html/css/cucumber.css +226 -0
  49. data/lib/templates/default/fulldoc/html/directories.erb +27 -0
  50. data/lib/templates/default/fulldoc/html/full_list_featuredirectories.erb +11 -0
  51. data/lib/templates/default/fulldoc/html/full_list_features.erb +37 -0
  52. data/lib/templates/default/fulldoc/html/full_list_stepdefinitions.erb +20 -0
  53. data/lib/templates/default/fulldoc/html/full_list_steps.erb +20 -0
  54. data/lib/templates/default/fulldoc/html/full_list_tags.erb +16 -0
  55. data/lib/templates/default/fulldoc/html/js/cucumber.js +333 -0
  56. data/lib/templates/default/fulldoc/html/setup.rb +208 -0
  57. data/lib/templates/default/layout/html/setup.rb +131 -0
  58. data/lib/templates/default/requirements/html/alpha_table.erb +26 -0
  59. data/lib/templates/default/requirements/html/requirements.erb +50 -0
  60. data/lib/templates/default/requirements/html/setup.rb +51 -0
  61. data/lib/templates/default/steptransformers/html/header.erb +12 -0
  62. data/lib/templates/default/steptransformers/html/index.erb +10 -0
  63. data/lib/templates/default/steptransformers/html/setup.rb +94 -0
  64. data/lib/templates/default/steptransformers/html/transformers.erb +80 -0
  65. data/lib/templates/default/steptransformers/html/undefinedsteps.erb +26 -0
  66. data/lib/templates/default/tag/html/alpha_table.erb +33 -0
  67. data/lib/templates/default/tag/html/setup.rb +27 -0
  68. data/lib/templates/default/tag/html/tag.erb +35 -0
  69. data/lib/yard-nrser-cucumber.rb +49 -0
  70. data/lib/yard/code_objects/cucumber/base.rb +24 -0
  71. data/lib/yard/code_objects/cucumber/feature.rb +16 -0
  72. data/lib/yard/code_objects/cucumber/namespace_object.rb +55 -0
  73. data/lib/yard/code_objects/cucumber/scenario.rb +25 -0
  74. data/lib/yard/code_objects/cucumber/scenario_outline.rb +68 -0
  75. data/lib/yard/code_objects/cucumber/step.rb +41 -0
  76. data/lib/yard/code_objects/cucumber/tag.rb +31 -0
  77. data/lib/yard/code_objects/step_definition.rb +4 -0
  78. data/lib/yard/code_objects/step_transform.rb +4 -0
  79. data/lib/yard/code_objects/step_transformer.rb +94 -0
  80. data/lib/yard/handlers/constant_transform_handler.rb +98 -0
  81. data/lib/yard/handlers/cucumber/base.rb +21 -0
  82. data/lib/yard/handlers/cucumber/feature_handler.rb +131 -0
  83. data/lib/yard/handlers/legacy/step_definition_handler.rb +45 -0
  84. data/lib/yard/handlers/legacy/step_transform_handler.rb +24 -0
  85. data/lib/yard/handlers/step_definition_handler.rb +86 -0
  86. data/lib/yard/handlers/step_transform_handler.rb +50 -0
  87. data/lib/yard/nrser/cucumber/version.rb +103 -0
  88. data/lib/yard/parser/cucumber/feature.rb +72 -0
  89. data/lib/yard/server/adapter.rb +43 -0
  90. data/lib/yard/server/commands/list_command.rb +31 -0
  91. data/lib/yard/server/router.rb +32 -0
  92. data/lib/yard/templates/helpers/base_helper.rb +26 -0
  93. data/lib/yard/templates/helpers/html_helper.rb +153 -0
  94. data/yard-nrser-cucumber.gemspec +75 -0
  95. metadata +220 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: '028e8ef70552f13791e6844c320c0744dc46e863'
4
+ data.tar.gz: 1ca37f690523251fbbdffe9dd8f9fc79dae19d0d
5
+ SHA512:
6
+ metadata.gz: 8f3ad75050f8c52ed619b1b4ca6c9ae4c059e64dcbdc481e981b9b4429db43b9ce144fe830282fabb0ee822c0fe2e857001cfe941ff97723f32ff6b7cc420349
7
+ data.tar.gz: c6051e9111a4617bd171f0354a63aac6b1e1ec4ffa2ed43465cecf4ac65eb461b971b99479972270768428b78b714911ff037171c3647187f1f3b8867f3de279
data/.gitignore ADDED
@@ -0,0 +1,61 @@
1
+ ##############################################################################
2
+ # BEGIN Ruby.gitingore
3
+ #
4
+ # General Git ignore file for Ruby, including support for:
5
+ #
6
+ # - Bundler
7
+ # - RDoc and Yard
8
+ # - RBEnv and RVM
9
+ # - DotEnv (optional)
10
+ #
11
+ # Additional support is available in separate ignore files:
12
+ #
13
+ # - Gem.gitignore (for gem source directories)
14
+ # - Rails.gitignore
15
+ # - RubyMotion.gitignore
16
+ #
17
+
18
+ /*.gem
19
+ *.rbc
20
+ /.config
21
+ /coverage/
22
+ /InstalledFiles
23
+ /pkg/
24
+ /spec/reports/
25
+ /spec/examples.txt
26
+ /test/tmp/
27
+ /test/version_tmp/
28
+ /tmp/
29
+
30
+ # Used by dotenv library to load environment variables.
31
+ # .env
32
+
33
+ ## Documentation cache and generated files:
34
+ /.yardoc/
35
+ /_yardoc/
36
+ # /doc/ # We Use `//doc` for additional hand-written documentation
37
+ /site/
38
+ /rdoc/
39
+
40
+ ## Environment normalization:
41
+ .bundle/
42
+ /vendor/bundle
43
+ /lib/bundler/man/
44
+
45
+ # for a library or gem, add `Gem.gitignore`
46
+
47
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
48
+ .rvmrc
49
+ #
50
+ # END Ruby.gitingore
51
+ ##############################################################################
52
+
53
+ ##############################################################################
54
+ # BEGIN Gem.gitingore
55
+ #
56
+ /Gemfile.lock
57
+ # /.ruby-version `yard-cucumber` had this checked in, leaving for now
58
+ /.ruby-gemset
59
+ #
60
+ # END Gem.gitingore
61
+ ##############################################################################
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ # /.rspec
2
+ --format d
3
+ --color
data/.yardopts ADDED
@@ -0,0 +1,2 @@
1
+ --output-dir ./site
2
+ --plugin yard-cucumber
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'redcarpet'
4
+ gem 'gherkin', '>= 4.0', '< 6.0'
5
+
6
+ gemspec
data/History.txt ADDED
@@ -0,0 +1,288 @@
1
+ === 4.0.0 / 2018-02-25
2
+
3
+ * @wellavelino: Adjusts the indentation of several project classes
4
+ (https://github.com/burtlo/yard-cucumber/pull/89)
5
+ * @elhuang: Adding example tags and scenarios counts
6
+ (https://github.com/burtlo/yard-cucumber/pull/87)
7
+ * @weh: Update README.md
8
+ (https://github.com/burtlo/yard-cucumber/pull/84)
9
+ * @weh: Fix Gem Load Error
10
+ (https://github.com/burtlo/yard-cucumber/pull/83)
11
+ * @Stephen-Kaye: Transforms with CONSTANTS
12
+ (https://github.com/burtlo/yard-cucumber/pull/79)
13
+
14
+ === 3.1.0/ 2016-12-06
15
+
16
+ * Updates to Gherkin 4.0 and Cucumber 2.4.0
17
+ * Fixes issues with the formatting that comes from these changes
18
+
19
+ === 2.3.2/ 2013-11-08
20
+
21
+ * De-duping uses of step definitions when the line number is the same (ipwnstuff)
22
+
23
+ === 2.3.1/ 2013-07-12
24
+
25
+ * Fixes for Cucumber ~> 1.3 and gherkin ~> 2.12 by loading
26
+ a required platform file.
27
+ * Added appropriate MIT license
28
+
29
+ === 2.3.0/ 2013-07-12
30
+
31
+ * Fixes for Cucumber ~> 1.3 and gherkin ~> 2.12 by loading
32
+ a required platform file.
33
+
34
+ === 2.2.3/ 2013-02-15
35
+
36
+ * Step Definitions that are marked as 'pending' will now appear as pending
37
+ on the step definition and transforms page.
38
+
39
+ === 2.2.2/ 2012-10-07
40
+
41
+ * Steps and Definitions have links to step transformer page
42
+ * Step definitions in the search menu no longer expand constants
43
+
44
+ === 2.2.1/ 2012-09-29
45
+
46
+ * Fixes and compatibility with JRuby (Thanks @singram)
47
+
48
+ === 2.2.0/ 2012-05-29
49
+
50
+ * Fixes and changes to become compatible with YARD 0.8.1
51
+
52
+ === 2.1.7/ 2011-11-24
53
+
54
+ * Better parsing support for doc_strings (thanks @nikosd)
55
+
56
+ === 2.1.6 / 2011-11-24
57
+
58
+ * FIX for yard-server (Thanks @msolovyov, @maxigit, @nikosd)
59
+
60
+ === 2.1.5 / 2011-10-19
61
+
62
+ * FIX for multiple scenario outlines (Thanks @ardavis)
63
+
64
+ === 2.1.4 / 2011-10-10
65
+
66
+ * Support for multiple scenario outlines (Thanks @jmerrifield)
67
+
68
+ === 2.1.3 / 2011-09-24
69
+
70
+ * Support for Gherkin ~ 2.5 (Thanks @turboladen)
71
+
72
+ === 2.1.2 / 2011-09-16
73
+
74
+ * JRuby Bug Fix (Thanks @aledalgrande)
75
+
76
+ === 2.1.1 / 2011-06-17
77
+
78
+ * Gherkin 2.4.0 Compatibility (Thanks @bowsersenior)
79
+
80
+ === 2.1.0 / 2011-05-22
81
+
82
+ * YARD 0.7.0 compatibility (removed some monkey-patching)
83
+ * Add more menus (Steps and Step Definitions)
84
+ * Define step definitions in your language Internalization (Ruby 1.9.2)
85
+
86
+ === 2.0.3 / 2011-05-22
87
+
88
+ * Updated Cucumber links to the new github organization
89
+
90
+ === 2.0.2 / 2011-04-06
91
+
92
+ - No Features/Tags will still generate landing pages instead of no pages
93
+ - Changed link to current gem 'yard-cucumber'
94
+
95
+ === 2.0.1 / 2011-03-14
96
+
97
+ - YARD 0.6.5 compatibility
98
+
99
+ === 2.0.0 / 2011-02-08
100
+
101
+ * Cucumber In The YARD becomes `yard-cucumber` and with that gains the
102
+ benefits of being a YARD plugin
103
+
104
+ === 1.7.9 / 2011-02-05
105
+
106
+ - FIX links to Scenarios and Transforms in various places
107
+ - FIX Comments on Step Definitions that may blow up
108
+
109
+ === 1.7.8 / 2011-01-30
110
+
111
+ * 'All Features' lands you on the root features directory; 'Requirements'
112
+ is still accessible through the breadcrumbs.
113
+ * Feature directory pages will display all the features in all subdirectories
114
+ * Better sorting for features, tags, and step transformers.
115
+
116
+ - FIX Feature-Scenario links and Cursors
117
+
118
+ === 1.7.7 / 2011-01-06
119
+
120
+ * Feature Directories now support a README.md file that can be used to provide
121
+ information (with markdown support) about the directory of features.
122
+
123
+ === 1.7.6 / 2011-01-06
124
+
125
+ * Feature descriptions, multi-line strings, and comments will preserve spacing.
126
+
127
+ === 1.7.5 / 2010-12-14
128
+
129
+ * FIX Step Transforms were colliding with Step Definitions in Ruby 1.9.2
130
+
131
+ === 1.7.4 / 2010-12-11
132
+
133
+ * Ruby 1.9.2 Support
134
+ * Change to YARD Server support:
135
+ yard server -e /path/to/gem/lib/server.b
136
+
137
+ === 1.7.3 / 2010-12-06
138
+
139
+ * Shortcut Keys (t) for tags and (r) for features (f was taken)
140
+ * Step definitions/transforms consolidate steps for easier viewing
141
+ and when they have no steps they are colored differently
142
+ * Tag filtering supports inverse (~) of tags
143
+
144
+ * FIX Scenario Outlines without examples will not crash the parser
145
+ * FIX Features, Scenarios, and Directories should display in alphabetic order
146
+ * FIX Comments and multiline strings will display correctly
147
+ * FIX Feature comments will show
148
+
149
+ === 1.7.2 / 2010-11-30
150
+
151
+ * Step Definition and Transform page enhancements
152
+ * Step Regex links to Rubular
153
+ * FIX Steps with HTML encoded characters will display correctly
154
+
155
+ === 1.7.1 / 2010-11-28
156
+
157
+ * Feature file with layout enhancements
158
+ * Scenarios are now linked/linkable
159
+ * FIX Scenario Outline error on CentOS, Ruby 1.8.7
160
+ * FIX Requiring Cucumber before Gherkin so that correct gherkin is loaded
161
+
162
+ === 1.7.0 / 2010-11-18
163
+
164
+ * Dynamic Tag Union / Intersection
165
+
166
+ === 1.6.4 / 2010-11-16
167
+
168
+ * `yard server` can now serve up requirements with YARD 0.6.2
169
+ * 'All Tags' page now has a cucumber tag AND filtering tool (beta)
170
+ * Step Defs and Transforms will show comments
171
+
172
+ * FIX removed warnings by no longer requiring YARD
173
+
174
+ === 1.6.2 / 2010-11-07
175
+
176
+ * Undefined Steps are displayed on the Step Transformer page
177
+ * Defined and Undefined steps are better linked to the Transformer page
178
+
179
+ * FIX Requirements tags were conflicting with YARD tags and being displayed
180
+ in multiple locations
181
+ * FIX Scenario Outlines Examples failed to show their tables or text
182
+
183
+ === 1.6.1 / 2010-11-04
184
+
185
+ * FIX - Feature Directries with sub-directories aborted serialization
186
+
187
+ === 1.6.0 / 2010-11-02
188
+
189
+ * Feature directories, subdirectories, and Tags breadcrumb pages are present
190
+ * Scenario Outlines now display each example inline when the example is clicked
191
+ * 'All Features' and 'All Tags' links in the search fields
192
+
193
+ === 1.5.4 / 2010-10-28
194
+
195
+ * Optimization - Found that for a large test suite that the processing time was
196
+ approaching 2 hours (oh boy!). Reduced that time to a few minutes by optimizing
197
+ the feature handler to cache all step definitions and step transforms.
198
+
199
+ * Step Transforms will now attempt to unpack any constants found within them.
200
+ * FIX - Step Transforms were not being parsed because the regex incorrectly included
201
+ the block.
202
+ * FIX - Features and Scenarios with multiple tags were not being displayed
203
+
204
+ === 1.5.3 / 2010-10-26
205
+
206
+ * FIX - Step Definition YARD handler regex was poorly formed and raised exceptions
207
+ when it contained a forward-slash (even if escaped).
208
+ * FIX - Step highlighting was causing 'Out Of Memory' issues because
209
+ gsub could not handle nil values.
210
+ * FIX - Step highlighting failed to replace matches properly causing for corrupted
211
+ HTML span values to appear in the highlighted step definitions
212
+
213
+ === 1.5.2 / 2010-10-26
214
+
215
+ * FIX - Step Transform YARD handler regex was poorly formed and raised exceptions
216
+ when a transform contained a forward-slash (even if escaped).
217
+
218
+ === 1.5.1 / 2010-10-26
219
+
220
+ * Unified Feature/Scenario search field that resembles the Namespace-Class field
221
+ * Tag search also displays immediate features/scenarios
222
+ * Removed Scenario searching field
223
+ * Added filename and line number to a number of locations
224
+ * Minor Tag template enhancements
225
+ * FIX - Scenario Outline Reference was being replaced with the first example
226
+ * FIX - Scenario Outlines were not getting counted for tags
227
+
228
+ === 1.5 / 2010-10-25
229
+
230
+ * Steps that have found their step definitions will also attempt to find their
231
+ step transforms (However step transforms are not unpacked yet like step
232
+ definitions).
233
+ * Scenario Outlines will expand, behind the scenes, and match like traditional
234
+ scenarios.
235
+ * FIX - duplication of owners that the tag reports has been removed.
236
+ * INFO level messaging while processing features and scenarios to help assist
237
+ with feedback during the long processing.
238
+
239
+ === 1.4 / 2010-10-17
240
+
241
+ * Tagusage has been retired
242
+ * Tags are found during parsing by name or created and all uses are appended to the exising or newly created object
243
+ * Tagusage template renamed and fixed up for just a tag and all the references
244
+ * Tags are named tag_TAG (removed the @ as it was encoded during file serialization and I couldn't find an encoder helper)
245
+ * Cleaned up all references in the fulldoc, full list to references tags
246
+
247
+ * Moved Cucumber CodeObjects, Handlers, and Parsers to a Cucumber sub-directory
248
+ * Moved StepDefinition and StepTransforms form extensions.rb to individual StepObject and Handlers files
249
+
250
+ * (lsegal advice) Created Cucumber Namespace and sub namespaces for features, tags, and step transformers.
251
+ * (lsegal advice) Started to break apart the feature.erb into smaller digestable erb sections
252
+
253
+ * Feature namespace now parallels the directory structure of the feature directory (from where it is parsed)
254
+ * Feature files have simpler names; i.e. featurefile.html instead of featurefile.feature.html
255
+ * Feature page title now states Feature: The Feature ( KEYWORD: FEATURE_TITLE )
256
+ * Moved the templates to lib/templates so I could use yard/templates to override the YARD helpers
257
+
258
+ * Changed document parsing to mirror the order imposed by Cucumber, this is to stop features being loaded before step definitions.
259
+ This should hopefully address the issue where steps were not being mapped correctly to step definitions. This fixed the issue
260
+ in the small and large test suite I ran it against.
261
+
262
+
263
+ === 1.3 / 2010-10-13
264
+
265
+ * (7rans requested) Step definitions to show their source code; required a better source definition to be stored during creation of the CodeObject
266
+ * Fixes to the Feature template which had some unclosed table header elements
267
+ * Scenario Outline helper methods added to Scenarios
268
+ * Scenario Outlines, Tables, and Multiline Strings had other minor CSS changes
269
+ * Step tables and Scenario Example tables are no longer locked to 150px; instead that is the minimum width
270
+ * Tables and Multiline Strings (PyStrings) are no longer displayed in the steps frame which was causing ugliness with the striping of the rows
271
+ * (lsegal strongly recommended) Removed the pervasive use of filename in the CodeObjects
272
+ * Cleaned up the fulldoc setup to remove the redundancy
273
+ * Updated all the templates to support the lack of filename
274
+
275
+ === 1.2 / 2010-10-10
276
+
277
+ * FIX: Empty Step Definitions caused failure during serialization
278
+ * FIX: Empty Step Definitions caused failure during rendering HTML
279
+
280
+ === 1.1 / 2010-10-10
281
+
282
+ * FIX: Feature template had references to old methods for description (when it was an array)
283
+ * FIX: Empty feature files caused the documentation to fail; ignoring emptying feature files
284
+ * FIX: Tags, Step definitions, and other CodeObjects that were not present caused rendering to fail; Checking for nil
285
+
286
+ === 1.0 / 2010-10-10
287
+
288
+ * Initial Release
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Franklin Webber
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
data/NAME ADDED
@@ -0,0 +1 @@
1
+ yard-nrser-cucumber
data/README.md ADDED
@@ -0,0 +1,198 @@
1
+ # YARD-Cucumber: A Requirements Documentation Tool
2
+
3
+ ## Synopsis
4
+
5
+ YARD-Cucumber (formerly Cucumber-In-The-Yard) is a YARD extension that processes
6
+ Cucumber features, scenarios, steps, tags, step definitions, and even transforms
7
+ to provide documentation similar to what you expect to how YARD displays
8
+ classes, methods and constants.This tools bridges the gap of having feature
9
+ files found in your source code and true documentation that your team, product
10
+ owners and stakeholders can use.
11
+
12
+ ## Examples
13
+
14
+ I have created a trivial, example project to help provide a quick
15
+ visualization of the resulting documentation. I encourage you to look at it as
16
+ an example and see if it would assist your project from a multitude of
17
+ perspectives: as the project's core developer; another developer or a new
18
+ developer; quality assurance engineer; or product owner/stakeholder.
19
+
20
+ The implemented example has been deployed at [http://burtlo.github.io/yard-cucumber/](http://burtlo.github.io/yard-cucumber/).
21
+
22
+ **1. View Features and Scenarios** [example](http://burtlo.github.io/yard-cucumber/requirements.html)
23
+
24
+ **2. Search through [features, scenarios](http://burtlo.github.io/yard-cucumber/feature_list.html), and [tags](http://burtlo.github.io/yard-cucumber/tag_list.html)**
25
+
26
+ **3. Dynamic Tag Unions and Intersections** [example](http://burtlo.github.io/yard-cucumber/requirements/tags.html)
27
+
28
+ **4. View all features and scenarios by tag** [example](http://burtlo.github.io/yard-cucumber/requirements/tags/bvt.html)
29
+
30
+ **5. View Step Definitions and Transforms** [example](http://burtlo.github.io/yard-cucumber/requirements/step_transformers.html)
31
+
32
+ **6. All steps [matched](http://burtlo.github.io/yard-cucumber/requirements/step_transformers.html#definition_5-stepdefinition) to step definitions**
33
+
34
+ **7. [Steps](http://burtlo.github.io/yard-cucumber/requirements/step_transformers.html#step_transform7-steptransform) that have transforms applied to them**
35
+
36
+ **8. [Undefined steps](http://burtlo.github.io/yard-cucumber/requirements/step_transformers.html#undefined_steps) and even [Rubular](http://rubular.com/) links of your step definitions.**
37
+
38
+ **9. Feature directories with a README.md will be parsed into the description** [example](http://burtlo.github.io/yard-cucumber/requirements/example/child_feature.html)
39
+
40
+ **10. Configurable Menus - want a searchable steps menu and remove the tags menu**
41
+
42
+ **11. Step definitions in your language (Ruby 1.9.2 - Internationalization)**
43
+
44
+ ## Installation
45
+
46
+ YARD-Cucumber requires the following gems installed:
47
+
48
+ Gherkin 2.2.9 - http://cukes.info
49
+ Cucumber 0.7.5 - http://cukes.info
50
+ YARD 0.8.1 - http://yardoc.org
51
+
52
+ To install `yard-cucumber` use the following command:
53
+
54
+ ```bash
55
+ $ gem install yard-cucumber
56
+ ```
57
+
58
+ (Add `sudo` if you're installing under a POSIX system as root)
59
+
60
+ ## Usage
61
+
62
+ YARD supports for automatically including gems with the prefix `yard-`
63
+ as a plugin. To enable automatic loading yard-cucumber.
64
+
65
+ ```bash
66
+ $ mkdir ~/.yard
67
+ $ yard config load_plugins true
68
+ $ yardoc 'example/**/*.rb' 'example/**/*.feature'
69
+ ```
70
+
71
+ Now you can run YARD as you [normally](https://github.com/lsegal/yard) would and
72
+ have your features, step definitions and transforms captured.
73
+
74
+ An example with the rake task:
75
+
76
+ ```ruby
77
+ require 'yard'
78
+
79
+ YARD::Rake::YardocTask.new do |t|
80
+ t.files = ['features/**/*.feature', 'features/**/*.rb']
81
+ t.options = ['--any', '--extra', '--opts'] # optional
82
+ end
83
+ ```
84
+
85
+
86
+ ## Configuration
87
+
88
+ * Adding or Removing search fields (yardoc)
89
+
90
+ Be default the yardoc output will generate a search field for features and tags.
91
+ This can be configured through the yard configuration file `~/.yard/config` to
92
+ add or remove these search fields.
93
+
94
+ ```yaml
95
+ --- !ruby/hash-with-ivars:SymbolHash
96
+ elements:
97
+ :load_plugins: true
98
+ :ignored_plugins: []
99
+ :autoload_plugins: []
100
+ :safe_mode: false
101
+ :"yard-cucumber":
102
+ menus: [ 'features', 'directories', 'tags', 'steps', 'step definitions' ]
103
+ ivars:
104
+ :@symbolize_value: false
105
+ ```
106
+
107
+ By default the configuration, yaml format, that is generate by the `yard config`
108
+ command will save a `SymbolHash`. You can still edit this file add the entry for
109
+ `:"yard-cucumber":` and the sub-entry `menus:` which can contain all of the above
110
+ mentioned menus or simply an empty array `[]` if you want no additional menus.
111
+
112
+ * Step definitions in your language (Ruby 1.9.2)
113
+
114
+ Again the yard configuration file you can define additional step definitions
115
+ that can be matched.
116
+
117
+ ```yaml
118
+ :"yard-cucumber":
119
+ language:
120
+ step_definitions: [ 'Given', 'When', 'Then', 'And', 'Soit', 'Etantdonné', 'Lorsque', 'Lorsqu', 'Alors', 'Et' ]
121
+ ```
122
+
123
+ In this example, I have included the French step definition words alongside the
124
+ English step definitions. Even without specifying this feature files in other
125
+ languages are found, this provides the ability for the step definitions to match
126
+ correctly to step definitions.
127
+
128
+ * Exclude features or scenarios from yardoc
129
+
130
+ You can exclude any feature or scenario from the yardoc by adding a predefined tags to them.
131
+ To define tags that will be excluded, again in yard configuration file:
132
+
133
+ ```yaml
134
+ :"yard-cucumber":
135
+ exclude_tags: [ 'exclude-yardoc', 'also-exclude-yardoc' ]
136
+ ```
137
+
138
+ ## Details
139
+
140
+ There are two things that I enjoy: a test framework written in my own Domain
141
+ Specific Language (DSL) that is easily understood by all those on a project
142
+ and the ability for all participants to easily read, search, and view the tests.
143
+
144
+ Cucumber is an amazing tool that allowed me to define exercisable requirements.
145
+ My biggest obstacle was bringing these requirements to my team, the product
146
+ owner, and other stakeholders.
147
+
148
+ Initially I tried to expose more of the functionality by providing freshly
149
+ authored requirements through email, attachments to JIRA tickets, or linked in
150
+ wiki documents. None of these methods were very sustainable or successful.
151
+ First, I was continually pushing out the documents to those interested.
152
+ Second, the documents were displayed to the user in text without the syntax
153
+ highlighting that was exceedingly helpful for quickly understanding the requirements.
154
+
155
+ I also found it hard to share the test framework that I had put together with
156
+ another developer that joined the team. It was difficult to direct them around
157
+ the features, tags, step definitions, and transforms. It was when I started to
158
+ convey to them the conventions that I had established that I wished I had a
159
+ tool that would allow me to provide documentation like one would find generated
160
+ by a great tool like YARD.
161
+
162
+ So I set out to integrate Cucumber objects like features, backgrounds,
163
+ scenarios, tags, steps, step definitions, and transforms into a YARD template.
164
+ From my quick survey of the landscape I can see that the my needs are
165
+ different than a lot of others that use Cucumber. The entire project that
166
+ spawned this effort was solely to exercise the functionality of a different,
167
+ large project and so there is a huge dependence on having the requirements
168
+ documented. This is in contrast to other projects that are using this on a
169
+ small scale to test the functionality of small software component. Though,
170
+ ultimately, I realized that the functionality may provide a valuable tool for
171
+ many as I feel it helps more solidly bridge the reporting of the documentation
172
+ by putting a coat of paint on it.
173
+
174
+
175
+ ## LICENSE
176
+
177
+ (The MIT License)
178
+
179
+ Copyright (c) 2011 Franklin Webber
180
+
181
+ Permission is hereby granted, free of charge, to any person obtaining
182
+ a copy of this software and associated documentation files (the
183
+ 'Software'), to deal in the Software without restriction, including
184
+ without limitation the rights to use, copy, modify, merge, publish,
185
+ distribute, sublicense, and/or sell copies of the Software, and to
186
+ permit persons to whom the Software is furnished to do so, subject to
187
+ the following conditions:
188
+
189
+ The above copyright notice and this permission notice shall be
190
+ included in all copies or substantial portions of the Software.
191
+
192
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
193
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
194
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
195
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
196
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
197
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
198
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.