yard-cucumber 2.1.7 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +3 -0
- data/Gemfile.lock +28 -0
- data/History.txt +4 -0
- data/README.md +64 -63
- data/city.gemspec +1 -1
- data/lib/templates/default/fulldoc/html/full_list_features.erb +14 -13
- data/lib/templates/default/fulldoc/html/full_list_stepdefinitions.erb +7 -5
- data/lib/templates/default/fulldoc/html/full_list_steps.erb +1 -1
- data/lib/templates/default/fulldoc/html/js/cucumber.js +0 -17
- data/lib/templates/default/requirements/html/requirements.erb +1 -1
- data/lib/yard-cucumber.rb +1 -1
- metadata +29 -12
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
yard-cucumber (2.1.7)
|
5
|
+
cucumber (>= 0.7.5)
|
6
|
+
gherkin (>= 2.2.9)
|
7
|
+
yard (>= 0.8.1)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: http://rubygems.org/
|
11
|
+
specs:
|
12
|
+
builder (3.0.0)
|
13
|
+
cucumber (1.2.0)
|
14
|
+
builder (>= 2.1.2)
|
15
|
+
diff-lcs (>= 1.1.3)
|
16
|
+
gherkin (~> 2.10.0)
|
17
|
+
json (>= 1.4.6)
|
18
|
+
diff-lcs (1.1.3)
|
19
|
+
gherkin (2.10.0)
|
20
|
+
json (>= 1.4.6)
|
21
|
+
json (1.7.3)
|
22
|
+
yard (0.8.1)
|
23
|
+
|
24
|
+
PLATFORMS
|
25
|
+
ruby
|
26
|
+
|
27
|
+
DEPENDENCIES
|
28
|
+
yard-cucumber!
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -1,23 +1,20 @@
|
|
1
|
-
YARD-Cucumber: A Requirements Documentation Tool
|
2
|
-
====================================
|
1
|
+
# YARD-Cucumber: A Requirements Documentation Tool
|
3
2
|
|
4
|
-
Synopsis
|
5
|
-
--------
|
3
|
+
## Synopsis
|
6
4
|
|
7
5
|
YARD-Cucumber (formerly Cucumber-In-The-Yard) is a YARD extension that processes
|
8
|
-
Cucumber features, scenarios, steps, tags, step definitions, and even transforms
|
9
|
-
to provide documentation similar to what you expect to how YARD displays
|
10
|
-
methods and constants.This tools bridges the gap of having feature
|
11
|
-
your source code and true documentation that your team, product
|
12
|
-
stakeholders can use.
|
13
|
-
|
14
|
-
Examples
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
perspectives: as the project's core developer; another developer or a new
|
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
|
21
18
|
developer; quality assurance engineer; or product owner/stakeholder.
|
22
19
|
|
23
20
|
The implemented example has been deployed at [http://recursivegames.com/cukes/](http://recursivegames.com/cukes/).
|
@@ -44,110 +41,115 @@ The implemented example has been deployed at [http://recursivegames.com/cukes/](
|
|
44
41
|
|
45
42
|
**11. Step definitions in your language (Ruby 1.9.2 - Internationalization)**
|
46
43
|
|
47
|
-
Installation
|
48
|
-
------------
|
44
|
+
## Installation
|
49
45
|
|
50
46
|
YARD-Cucumber requires the following gems installed:
|
51
47
|
|
52
48
|
Gherkin 2.2.9 - http://cukes.info
|
53
49
|
Cucumber 0.7.5 - http://cukes.info
|
54
|
-
YARD 0.
|
50
|
+
YARD 0.8.1 - http://yardoc.org
|
55
51
|
|
56
52
|
To install `yard-cucumber` use the following command:
|
57
53
|
|
58
|
-
|
54
|
+
```bash
|
55
|
+
$ gem install yard-cucumber
|
56
|
+
```
|
59
57
|
|
60
58
|
(Add `sudo` if you're installing under a POSIX system as root)
|
61
59
|
|
62
|
-
Usage
|
63
|
-
-----
|
60
|
+
## Usage
|
64
61
|
|
65
|
-
YARD supports for automatically including gems with the prefix `yard-`
|
66
|
-
as a plugin. To enable automatic loading yard-cucumber.
|
62
|
+
YARD supports for automatically including gems with the prefix `yard-`
|
63
|
+
as a plugin. To enable automatic loading yard-cucumber.
|
67
64
|
|
68
|
-
|
69
|
-
|
70
|
-
|
65
|
+
```bash
|
66
|
+
$ mkdir ~/.yard
|
67
|
+
$ yard config load_plugins true
|
68
|
+
$ yardoc 'example/**/*.rb' 'example/**/*.feature'
|
69
|
+
```
|
71
70
|
|
72
|
-
Now you can run YARD as you [normally](https://github.com/lsegal/yard) would and
|
71
|
+
Now you can run YARD as you [normally](https://github.com/lsegal/yard) would and
|
73
72
|
have your features, step definitions and transforms captured.
|
74
73
|
|
75
74
|
An example with the rake task:
|
76
75
|
|
77
|
-
|
76
|
+
```ruby
|
77
|
+
require 'yard'
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
YARD::Rake::YardocTask.new do |t|
|
80
|
+
t.files = ['features/**/*.feature', 'features/**/*.rb']
|
81
|
+
t.options = ['--any', '--extra', '--opts'] # optional
|
82
|
+
end
|
83
|
+
```
|
83
84
|
|
84
85
|
|
85
|
-
Configuration
|
86
|
-
-------------
|
86
|
+
## Configuration
|
87
87
|
|
88
88
|
* Adding or Removing search fields (yardoc)
|
89
89
|
|
90
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
|
91
|
+
This can be configured through the yard configuration file `~/.yard/config` to
|
92
92
|
add or remove these search fields.
|
93
|
-
|
94
|
-
--- !map:SymbolHash
|
95
|
-
:load_plugins: true
|
96
|
-
:ignored_plugins: []
|
97
93
|
|
98
|
-
|
94
|
+
```yaml
|
95
|
+
--- !map:SymbolHash
|
96
|
+
:load_plugins: true
|
97
|
+
:ignored_plugins: []
|
99
98
|
|
100
|
-
|
101
|
-
|
102
|
-
:"yard-cucumber":
|
103
|
-
menus: [ 'features', 'tags', 'steps', 'stepdefinitions' ]
|
99
|
+
:autoload_plugins: []
|
104
100
|
|
101
|
+
:safe_mode: false
|
105
102
|
|
106
|
-
|
107
|
-
|
103
|
+
:"yard-cucumber":
|
104
|
+
menus: [ 'features', 'tags', 'steps', 'step definitions' ]
|
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
|
108
109
|
`:"yard-cucumber":` and the sub-entry `menus:` which can contain all of the above
|
109
110
|
mentioned menus or simply an empty array `[]` if you want no additional menus.
|
110
111
|
|
111
112
|
* Step definitions in your language (Ruby 1.9.2)
|
112
113
|
|
113
|
-
Again the yard configuration file you can define additional step definitions
|
114
|
-
can be matched.
|
114
|
+
Again the yard configuration file you can define additional step definitions
|
115
|
+
that can be matched.
|
115
116
|
|
116
|
-
|
117
|
-
|
118
|
-
|
117
|
+
```yaml
|
118
|
+
:"yard-cucumber":
|
119
|
+
language:
|
120
|
+
step_definitions: [ 'Given', 'When', 'Then', 'And', 'Soit', 'Etantdonné', 'Lorsque', 'Lorsqu', 'Alors', 'Et' ]
|
121
|
+
```
|
119
122
|
|
120
123
|
In this example, I have included the French step definition words alongside the
|
121
124
|
English step definitions. Even without specifying this feature files in other
|
122
125
|
languages are found, this provides the ability for the step definitions to match
|
123
126
|
correctly to step definitions.
|
124
127
|
|
125
|
-
Details
|
126
|
-
--------
|
128
|
+
## Details
|
127
129
|
|
128
130
|
There are two things that I enjoy: a test framework written in my own Domain
|
129
131
|
Specific Language (DSL) that is easily understood by all those on a project
|
130
132
|
and the ability for all participants to easily read, search, and view the tests.
|
131
133
|
|
132
|
-
Cucumber is an amazing tool that allowed me to define exercisable requirements.
|
134
|
+
Cucumber is an amazing tool that allowed me to define exercisable requirements.
|
133
135
|
My biggest obstacle was bringing these requirements to my team, the product
|
134
136
|
owner, and other stakeholders.
|
135
137
|
|
136
138
|
Initially I tried to expose more of the functionality by providing freshly
|
137
139
|
authored requirements through email, attachments to JIRA tickets, or linked in
|
138
|
-
wiki documents. None of these methods were very sustainable or successful.
|
139
|
-
First, I was continually pushing out the documents to those interested.
|
140
|
+
wiki documents. None of these methods were very sustainable or successful.
|
141
|
+
First, I was continually pushing out the documents to those interested.
|
140
142
|
Second, the documents were displayed to the user in text without the syntax
|
141
143
|
highlighting that was exceedingly helpful for quickly understanding the requirements.
|
142
144
|
|
143
145
|
I also found it hard to share the test framework that I had put together with
|
144
146
|
another developer that joined the team. It was difficult to direct them around
|
145
|
-
the features, tags, step definitions, and transforms. It was when I started to
|
147
|
+
the features, tags, step definitions, and transforms. It was when I started to
|
146
148
|
convey to them the conventions that I had established that I wished I had a
|
147
|
-
tool that would allow me to provide documentation like one would find generated
|
149
|
+
tool that would allow me to provide documentation like one would find generated
|
148
150
|
by a great tool like YARD.
|
149
151
|
|
150
|
-
So I set out to integrate Cucumber objects like features, backgrounds,
|
152
|
+
So I set out to integrate Cucumber objects like features, backgrounds,
|
151
153
|
scenarios, tags, steps, step definitions, and transforms into a YARD template.
|
152
154
|
From my quick survey of the landscape I can see that the my needs are
|
153
155
|
different than a lot of others that use Cucumber. The entire project that
|
@@ -160,8 +162,7 @@ many as I feel it helps more solidly bridge the reporting of the documentation
|
|
160
162
|
by putting a coat of paint on it.
|
161
163
|
|
162
164
|
|
163
|
-
LICENSE
|
164
|
-
-------
|
165
|
+
## LICENSE
|
165
166
|
|
166
167
|
(The MIT License)
|
167
168
|
|
data/city.gemspec
CHANGED
@@ -56,7 +56,7 @@ Gem::Specification.new do |s|
|
|
56
56
|
|
57
57
|
s.add_dependency 'gherkin', '>= 2.2.9'
|
58
58
|
s.add_dependency 'cucumber', '>= 0.7.5'
|
59
|
-
s.add_dependency 'yard', '>= 0.
|
59
|
+
s.add_dependency 'yard', '>= 0.8.1'
|
60
60
|
|
61
61
|
s.rubygems_version = "1.3.7"
|
62
62
|
s.files = `git ls-files`.split("\n")
|
@@ -5,24 +5,25 @@
|
|
5
5
|
<% n = n == 2 ? 1 : 2 %>
|
6
6
|
<% @items.each do |feature| %>
|
7
7
|
<li class="r<%= n %>">
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
<%= "<a class='toggle'></a>" unless feature.scenarios.empty? %>
|
9
|
+
<%= linkify feature, feature.value %>
|
10
|
+
<small><%= feature.location %></small>
|
11
11
|
</li>
|
12
12
|
<% n = n == 2 ? 1 : 2 %>
|
13
13
|
<% if feature.scenarios %>
|
14
14
|
<ul>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
<% feature.scenarios.each_with_index do |scenario,index| %>
|
16
|
+
<li class="r<%= n %>">
|
17
|
+
<span class='object_link'>
|
18
|
+
<a href="<%= url_for(scenario.feature,"scenario_#{index}") %>"
|
19
|
+
title="<%= h scenario.value %>">
|
20
|
+
<%= h scenario.value %>
|
21
|
+
</a>
|
22
|
+
</span>
|
23
|
+
<small><%= scenario.location %></small>
|
24
|
+
</li>
|
24
25
|
<% n = n == 2 ? 1 : 2 %>
|
25
|
-
|
26
|
+
<% end %>
|
26
27
|
</ul>
|
27
28
|
<% end %>
|
28
29
|
<% end %>
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<% n = 1 %>
|
2
2
|
<% @items.each do |stepdef| %>
|
3
3
|
<li class="r<%= n %>">
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
<span class='object_link'>
|
5
|
+
<span class="pre"><%= stepdef.keyword %></span>
|
6
|
+
<a href="<%= url_for stepdef %>" title="<%= h stepdef.value %>">
|
7
|
+
<span class="name"><%= h(stepdef.value) %></span>
|
8
|
+
</a>
|
9
|
+
</span>
|
10
|
+
<small><%= h(stepdef.location) %></small>
|
9
11
|
</li>
|
10
12
|
<% n = n == 2 ? 1 : 2 %>
|
11
13
|
<% end %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% @items.each do |step| %>
|
3
3
|
<li class="r<%= n %>">
|
4
4
|
<span class='object_link'>
|
5
|
-
<a href="<%= url_for step.scenario.feature %>">
|
5
|
+
<a href="<%= url_for step.scenario.feature %>" title="<%= h step.value %>">
|
6
6
|
<span class="pre"><%= step.keyword %></span>
|
7
7
|
<span class="name"><%= h(step.value) %></span>
|
8
8
|
</a>
|
@@ -1,18 +1,3 @@
|
|
1
|
-
function cucumberSearchFrameLinks() {
|
2
|
-
$('#feature_list_link').click(function() {
|
3
|
-
toggleSearchFrame(this, relpath + 'feature_list.html');
|
4
|
-
});
|
5
|
-
$('#tag_list_link').click(function() {
|
6
|
-
toggleSearchFrame(this, relpath + 'tag_list.html');
|
7
|
-
});
|
8
|
-
$('#step_list_link').click(function() {
|
9
|
-
toggleSearchFrame(this, relpath + 'step_list.html');
|
10
|
-
});
|
11
|
-
$('#stepdefinition_list_link').click(function() {
|
12
|
-
toggleSearchFrame(this, relpath + 'stepdefinition_list.html');
|
13
|
-
});
|
14
|
-
}
|
15
|
-
|
16
1
|
function cucumberKeyboardShortcuts() {
|
17
2
|
if (window.top.frames.main) return;
|
18
3
|
$(document).keypress(function(evt) {
|
@@ -29,10 +14,8 @@ function cucumberKeyboardShortcuts() {
|
|
29
14
|
});
|
30
15
|
}
|
31
16
|
|
32
|
-
$(cucumberSearchFrameLinks);
|
33
17
|
$(cucumberKeyboardShortcuts);
|
34
18
|
|
35
|
-
|
36
19
|
$(function() {
|
37
20
|
|
38
21
|
//
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div id="cukes_logo"> </div>
|
3
3
|
<div id="cukes_links">
|
4
4
|
<a href="http://cukes.info/">Cucumber</a> |
|
5
|
-
<a href="http://github.com/
|
5
|
+
<a href="http://github.com/cucumber/cucumber/wiki/Gherkin">Gherkin</a> |
|
6
6
|
<a href="http://yardoc.org/">YARD</a> |
|
7
7
|
<a href="https://github.com/burtlo/yard-cucumber">YARD-Cucumber</a>
|
8
8
|
</div>
|
data/lib/yard-cucumber.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gherkin
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 2.2.9
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.2.9
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: cucumber
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,18 +37,28 @@ dependencies:
|
|
32
37
|
version: 0.7.5
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.7.5
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: yard
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
42
52
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
53
|
+
version: 0.8.1
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.8.1
|
47
62
|
description: ! " \n YARD-Cucumber is a YARD extension that processes Cucumber Features,
|
48
63
|
Scenarios, Steps,\n Step Definitions, Transforms, and Tags and provides a documentation
|
49
64
|
interface that allows you\n easily view and investigate the test suite. This
|
@@ -58,6 +73,8 @@ extra_rdoc_files:
|
|
58
73
|
files:
|
59
74
|
- .gitignore
|
60
75
|
- .rspec
|
76
|
+
- Gemfile
|
77
|
+
- Gemfile.lock
|
61
78
|
- History.txt
|
62
79
|
- README.md
|
63
80
|
- Rakefile
|
@@ -142,8 +159,8 @@ files:
|
|
142
159
|
homepage: http://github.com/burtlo/yard-cucumber
|
143
160
|
licenses: []
|
144
161
|
post_install_message: ! "\n(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
145
|
-
(::) (::) (::) (::)\n\n Thank you for installing yard-cucumber 2.
|
146
|
-
\ \n Changes:\n \n *
|
162
|
+
(::) (::) (::) (::)\n\n Thank you for installing yard-cucumber 2.2.0 / 2012-05-29.\n
|
163
|
+
\ \n Changes:\n \n * Fixes and changes to become compatible with YARD 0.8.1\n
|
147
164
|
\ \n\n(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n"
|
148
165
|
rdoc_options:
|
149
166
|
- --charset=UTF-8
|
@@ -163,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
180
|
version: '0'
|
164
181
|
requirements: []
|
165
182
|
rubyforge_project:
|
166
|
-
rubygems_version: 1.8.
|
183
|
+
rubygems_version: 1.8.24
|
167
184
|
signing_key:
|
168
185
|
specification_version: 3
|
169
186
|
summary: Cucumber Features in YARD
|