cucumber-in-the-yard 1.6.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,6 +1,10 @@
1
- === 1.6.3 / 2010-11-08
1
+ === 1.6.4 / 2010-11-16
2
2
 
3
- * FIX Step Definitions and Step Transforms incorrectly cached the YARD Constants
3
+ * `yard server` can now serve up requirements with YARD 0.6.2
4
+ * 'All Tags' page now has a cucumber tag AND filtering tool (beta)
5
+ * Step Defs and Transforms will show comments
6
+
7
+ * FIX removed warnings by no longer requiring YARD
4
8
 
5
9
  === 1.6.2 / 2010-11-07
6
10
 
data/Rakefile CHANGED
@@ -6,4 +6,8 @@ task :gendoc do
6
6
  `rm -rf doc`
7
7
  `rm -rf .yardoc`
8
8
  `yardoc -e lib/city.rb -p lib/templates 'example/**/*.*' --debug`
9
- end
9
+ end
10
+
11
+ task :server do
12
+ `yard server -e lib/city.rb --debug`
13
+ end
data/city.gemspec CHANGED
@@ -1,3 +1,4 @@
1
+ require 'YARD'
1
2
  require File.dirname(__FILE__) + "/lib/city"
2
3
 
3
4
  module CucumberInTheYARD
@@ -56,7 +57,7 @@ Gem::Specification.new do |s|
56
57
 
57
58
  s.add_dependency 'gherkin', '>= 2.2.9'
58
59
  s.add_dependency 'cucumber', '>= 0.7.5'
59
- s.add_dependency 'yard', '>= 0.6.1'
60
+ s.add_dependency 'yard', '>= 0.6.2'
60
61
 
61
62
  s.rubygems_version = "1.3.7"
62
63
  s.files = `git ls-files`.split("\n")
@@ -6,10 +6,16 @@ Transform /^background$/ do |background|
6
6
  "background"
7
7
  end
8
8
 
9
+ #
10
+ # This step transform converts "scenario" to "scenario"
11
+ #
9
12
  Transform /^scenario$/ do |scenario|
10
13
  "scenario"
11
14
  end
12
15
 
16
+ #
17
+ # This step definition is all about steps
18
+ #
13
19
  Given /^this (scenario|background|#{ORDER}) step$/ do |step|
14
20
  pending "step #{order}"
15
21
  end
data/lib/city.rb CHANGED
@@ -3,10 +3,8 @@ require 'cucumber/parser/gherkin_builder'
3
3
  require 'gherkin/parser/parser'
4
4
  require 'gherkin/formatter/tag_count_formatter'
5
5
 
6
- require 'yard'
7
-
8
6
  module CucumberInTheYARD
9
- VERSION = '1.6.3' unless defined?(CucumberInTheYARD::VERSION)
7
+ VERSION = '1.6.4' unless defined?(CucumberInTheYARD::VERSION)
10
8
  end
11
9
 
12
10
 
@@ -35,5 +33,19 @@ require File.dirname(__FILE__) + "/yard/handlers/step_transform_handler.rb"
35
33
 
36
34
  require File.dirname(__FILE__) + "/yard/parser/source_parser.rb"
37
35
  require File.dirname(__FILE__) + "/yard/templates/helpers/base_helper.rb"
36
+
37
+ require File.dirname(__FILE__) + "/yard/server/commands/list_command.rb"
38
+ require File.dirname(__FILE__) + "/yard/server/router.rb"
39
+
38
40
  require File.dirname(__FILE__) + "/yard/rake/city_task.rb"
39
41
 
42
+
43
+ #
44
+ # For `yard server` utilize the templates and the static files at these locations
45
+ # before using the defaults
46
+ #
47
+ YARD::Templates::Engine.register_template_path File.dirname(__FILE__) + '/templates'
48
+ YARD::Templates::Engine.register_template_path File.dirname(__FILE__) + '/docserver'
49
+
50
+ YARD::Server.register_static_path File.dirname(__FILE__) + "/templates/default/fulldoc/html"
51
+ YARD::Server.register_static_path File.dirname(__FILE__) + "/docserver/default/fulldoc/html"
@@ -0,0 +1,85 @@
1
+ function cucumberSearchFrameLinks() {
2
+ $('#features_list_link').click(function() {
3
+ toggleSearchFrame(this, '/' + library + '/features');
4
+ });
5
+ $('#tags_list_link').click(function() {
6
+ toggleSearchFrame(this, '/' + library + '/tags');
7
+ });
8
+ }
9
+
10
+ $(cucumberSearchFrameLinks);
11
+
12
+
13
+
14
+ function toggleScenarioExample(id,example) {
15
+
16
+ var element = $("#" + id + "Example" + example + "Steps")[0];
17
+
18
+ $('#' + id + ' tr').each(function(index) {
19
+ this.style.backgroundColor = (index % 2 == 0 ? '#FFFFFF' : '#F0F6F9' );
20
+ });
21
+
22
+ if (element.style.display != 'none') {
23
+ element = $("#" + id + "Steps")[0];
24
+ } else {
25
+ $('#' + id + ' .outline * tr')[example].style.backgroundColor = '#FFCC80';
26
+ }
27
+
28
+ $('#' + id + ' .steps').each(function(index) {
29
+ this.style.display = 'none';
30
+ });
31
+
32
+ element.style.display = 'block';
33
+
34
+ }
35
+
36
+ function determine_tags_used_in_formula(tag_string) {
37
+ //$("#tag_debug")[0].innerHTML = "";
38
+
39
+ tag_string = tag_string.replace(/^(\s+)|(\s+)$/,'').replace(/\s{2,}/,' ');
40
+
41
+ var tags = tag_string.match(/@\w+/g);
42
+
43
+ var return_tags = [];
44
+
45
+ if (tags != null) {
46
+ tags.forEach(function(tag, index, array) {
47
+ //$("#tag_debug")[0].innerHTML += tag + " ";
48
+ if (tag_list.indexOf(tag) != -1) { return_tags.push(tag); }
49
+ });
50
+ }
51
+
52
+ return return_tags;
53
+ }
54
+
55
+
56
+ function display_example_command_line(tags) {
57
+ $("#command_example")[0].innerHTML = "cucumber ";
58
+
59
+ if (tags.length > 0) {
60
+ $("#command_example")[0].innerHTML += "--tags " + tags.join(" --tags ");
61
+ }
62
+ }
63
+
64
+ function display_qualifying_features_and_scenarios(tags) {
65
+ //$("#tag_debug")[0].innerHTML = "";
66
+
67
+ if (tags.length > 0) {
68
+
69
+ $(".feature,.scenario").each(function(feature){
70
+ this.style.display = "none";
71
+ });
72
+
73
+ $(".feature.\\" + tags.join(".\\") + ",.scenario.\\" + tags.join(".\\")).each(function(feature) {
74
+ //$("#tag_debug")[0].innerHTML += feature + " " + this;
75
+ this.style.display = "block";
76
+ });
77
+
78
+
79
+ } else {
80
+ $(".feature,.scenario").each(function(feature){
81
+ this.style.display = "block";
82
+ });
83
+ }
84
+
85
+ }
@@ -0,0 +1,13 @@
1
+ <meta name="Content-Type" content="text/html; charset=UTF-8" />
2
+ <title><%= @page_title %></title>
3
+ <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" charset="utf-8" />
4
+ <link rel="stylesheet" href="/css/custom.css" type="text/css" media="screen" charset="utf-8" />
5
+ <link rel="stylesheet" href="/css/common.css" type="text/css" media="screen" charset="utf-8" />
6
+ <script type="text/javascript" charset="utf-8" src="/js/jquery.js"></script>
7
+ <script type="text/javascript" charset="utf-8" src="/js/autocomplete.js"></script>
8
+ <script type="text/javascript" charset="utf-8" src="/js/app.js"></script>
9
+ <script type="text/javascript" charset="utf-8" src="/js/live.js"></script>
10
+ <script type="text/javascript" charset="utf-8" src="/js/cucumber.js"></script>
11
+ <script type="text/javascript" charset="utf-8">
12
+ library = '<%= base_path(router.list_prefix) %>';
13
+ </script>
@@ -0,0 +1,37 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=<%= charset %>" />
6
+ <link rel="stylesheet" href="/css/full_list.css" type="text/css" media="screen" charset="utf-8" />
7
+ <link rel="stylesheet" href="/css/common.css" type="text/css" media="screen" charset="utf-8" />
8
+ <script type="text/javascript" charset="utf-8" src="/js/jquery.js"></script>
9
+ <script type="text/javascript" charset="utf-8" src="/js/full_list.js"></script>
10
+ <base id="base_target" target="_parent" />
11
+ </head>
12
+ <body>
13
+ <script type="text/javascript" charset="utf-8">
14
+ if (window.top.frames.main) {
15
+ document.getElementById('base_target').target = 'main';
16
+ document.body.className = 'frames';
17
+ }
18
+ </script>
19
+ <div id="content">
20
+ <h1 id="full_list_header"><%= @list_title %></h1>
21
+ <div id="nav">
22
+ <a target="_self" href="/<%= base_path(router.list_prefix) %>/features">Features</a> |
23
+ <a target="_self" href="/<%= base_path(router.list_prefix) %>/tags">Tags</a> |
24
+ <a target="_self" href="/<%= base_path(router.list_prefix) %>/class">Classes</a> |
25
+ <a target="_self" href="/<%= base_path(router.list_prefix) %>/methods">Methods</a> |
26
+ <a target="_self" href="/<%= base_path(router.list_prefix) %>/files">Files</a>
27
+ </div>
28
+ <div id="search">Search: <input type="text" /></div>
29
+
30
+
31
+ <ul id="full_list" class="<%= @list_class || @list_type %>">
32
+ <%= erb "full_list_#{@list_type}" %>
33
+ </ul>
34
+ </div>
35
+ </body>
36
+ </html>
37
+
@@ -0,0 +1,14 @@
1
+ include T('default/fulldoc/html')
2
+
3
+ def init
4
+ # This is the css class type; here we just default to class
5
+ @list_class = "class"
6
+ case @list_type.to_sym
7
+ when :features; @list_title = "Features"
8
+ when :tags; @list_title = "Tags"
9
+ when :class; @list_title = "Class List"
10
+ when :methods; @list_title = "Method List"
11
+ when :files; @list_title = "File List"
12
+ end
13
+ sections :full_list
14
+ end
@@ -1,37 +1,58 @@
1
1
  <% if @namespace %>
2
- <div class="requirements">
2
+ <div id="tags" class="requirements">
3
+ <script type="text/javascript" charset="utf-8">
4
+ var tag_list = [ <%= tags.collect{|t| "'#{t.value}'" }.join(',') %> ];
5
+
6
+ $(function() {
7
+ $("#tag_search").keyup(function(event) {
8
+ var tags = determine_tags_used_in_formula($("#tag_search")[0].value);
9
+ display_example_command_line(tags);
10
+ display_qualifying_features_and_scenarios(tags);
11
+ });
12
+ });
13
+ </script>
14
+
3
15
  <div class="title">
4
- <span class="name">Tags</span>
16
+ <span class="name">Requirements Tags</span>
17
+ </div>
18
+
19
+ <div class="tags"><span class="name">Tags:</span>
20
+ <%= tags.collect {|tag| linkify(tag,tag.value) }.join(",\n") %>
21
+ </div>
22
+
23
+ <div>
24
+ <input id="tag_search" type="text" />
5
25
  </div>
6
26
 
7
- <% i = 0 %>
8
- <table style="margin-left: 10px;">
9
- <tr>
10
- <td valign='top' width="50%">
11
- <% all_tags_by_letter.sort_by {|l,o| l.to_s }.each do |letter, objects| %>
12
- <% if (i += 1) % 8 == 0 %>
13
- </td><td valign='top' width="50%">
14
- <% i = 0 %>
15
- <% end %>
16
- <ul id="alpha_<%= letter %>" class="alpha">
17
- <li class="letter"><%= letter %></li>
18
- <ul>
19
- <% objects.each do |obj| %>
20
- <li>
21
- <%= linkify obj, obj.value %>
22
- <small>
23
- ( <%= obj.features.size > 0 ? "#{obj.features.size} feature#{obj.features.size > 1 ? 's' : ''}" : "" %>
24
- <%= " and " if obj.features.size > 0 && obj.scenarios.size > 0 %>
25
- <%= obj.scenarios.size > 0 ? "#{obj.scenarios.size} scenario#{obj.scenarios.size > 1 ? 's' : ''}" : "" %> )
26
- </small>
27
- </li>
28
- <% end %>
29
- </ul>
30
- </ul>
31
- <% end %>
32
- </td>
33
- </tr>
34
- </table>
27
+ <div id="command_example">cucumber</div>
28
+
29
+ <div id="features">
30
+ <div class="title">
31
+ <span class="name">Features</span>
32
+ </div>
33
+ <% n = 1 %>
34
+ <% features.each do |feature| %>
35
+ <li class="feature r<%= n %> <%= feature.tags.collect{|t| t.value }.join(" ") %>">
36
+ <%= linkify feature, feature.value %>
37
+ <small>(<%= h(feature.location) %>)</small>
38
+ </li>
39
+ <% n = n == 2 ? 1 : 2 %>
40
+ <% end %>
41
+ </div>
42
+
43
+ <div id="scenarios">
44
+ <div class="title">
45
+ <span class="name">Scenarios</span>
46
+ </div>
47
+ <% n = 1 %>
48
+ <% scenarios.each_with_index do |scenario,index| %>
49
+ <li class="scenario r<%= n %> <%= scenario.tags.collect{|t| t.value }.join(" ") %>">
50
+ <%= linkify scenario.feature, scenario.value %>
51
+ <small>(<%= h(scenario.feature.location) %>)</small>
52
+ </li>
53
+ <% n = n == 2 ? 1 : 2 %>
54
+ <% end %>
55
+ </div>
35
56
 
36
57
  </div>
37
58
  <% end %>
@@ -17,5 +17,13 @@ def all_tags_by_letter
17
17
  end
18
18
 
19
19
  def tags
20
- Registry.all(:tag)
20
+ @tags ||= Registry.all(:tag)
21
+ end
22
+
23
+ def features
24
+ @features ||= Registry.all(:feature).sort {|x,y| x.value <=> y.value }
25
+ end
26
+
27
+ def scenarios
28
+ @scenarios ||= Registry.all(:scenario).reject {|s| s.outline? || s.background? }.sort {|x,y| x.value <=> y.value }
21
29
  end
@@ -25,11 +25,13 @@
25
25
  .odd { background-color: #F0F6F9; }
26
26
  .even { background-color: #FFFFFF; }
27
27
 
28
- #background, #features { margin-top: 10px; margin-left: 20px; }
28
+ #background, #features, #scenarios { margin-top: 10px; margin-left: 20px; }
29
29
 
30
30
  #directory { margin-top: 20px; margin-left: 20px; }
31
31
 
32
32
  .scenario { margin-top: 40px; margin-left: 20px; }
33
+ .requirements * .scenario { margin-top: 0px; margin-left: 0px; }
34
+
33
35
  .scenario .title, #background .title {
34
36
  font-size: 16px;
35
37
  padding-left: 0px;
@@ -37,10 +39,8 @@
37
39
  border-bottom: 1px solid #E3E3E3;
38
40
  }
39
41
 
40
- #directory .title, #features .title { padding-left: 0px; margin-left: 10px; border-bottom: 1px solid #E3E3E3; }
41
- #directory .title .name, #features .title .name { font-weight: normal; }
42
-
43
-
42
+ #directory .title, #features .title, #scenarios .title { padding-left: 0px; margin-left: 10px; border-bottom: 1px solid #E3E3E3; }
43
+ #directory .title .name, #features .title .name, #scenarios .title .name { font-weight: normal; }
44
44
 
45
45
  #background .title .pre { color: #346F97; }
46
46
  .requirements .tags { margin-left: 50px; margin-right: 30px; }
@@ -117,13 +117,13 @@
117
117
 
118
118
 
119
119
  /* Overrides for scenarios in the tag view */
120
-
121
120
  .tag .feature { margin-left: 20px; }
122
121
  .tag .scenario { margin-top: 0px; margin-left: 20px; padding-left: 30px; }
123
122
  .tag .scenario .title { border-bottom: none; }
124
123
  .tag .scenario .meta { margin-top: 0px; }
125
124
  /* Overrides for scenarios in the tag view */
126
125
 
126
+ .stepdef * .docstring { margin-left: 20px; margin-top: 10px; padding: 5px 5px 5px 10px; }
127
127
 
128
128
  .stepdef .title {
129
129
  font-size: 14px;
@@ -137,6 +137,18 @@
137
137
  .stepdef .steps .step {
138
138
  padding: 4px;
139
139
  }
140
+ #tags * li { padding: 5px; padding-left: 12px; margin: 0 0 0 10px; font-size: 1.1em; list-style: none; }
141
+
142
+ .tag_search { margin-left: 40px; }
143
+ #tag_search { margin-left: 40px; width: 500px; height: 20px; }
144
+ #command_example {
145
+ margin: 10px 0px 0px 40px;
146
+ padding: 20px;
147
+ background-color: #F8F8FF;
148
+ color: #444444;
149
+ border: 1px solid #DEDEDE;
150
+ }
151
+
140
152
 
141
153
  #cukes_links { margin: 10px auto 10px auto;
142
154
  border-bottom: 1px solid #E3E3E3;
@@ -155,15 +167,15 @@
155
167
  margin: 0px auto 10px auto;
156
168
  width: 15px;
157
169
  height: 15px;
158
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAACXBIWXMAAA86AAAPOgGXOdvCAAABVklEQVQoFS2RO1IEMQxEJY+zzSDZlCNwAQIOxJm4DReAnICIIuFTW7U7lsxreTUzHltqtVqyPzw/HQ+3Oaebpc16EospszJ+OfP7/NePh5vHu/sRMfHw2RwxLjHOcQnlJHg42L9+vncIImOPQTbQOXPPHBmRE3o5RQMZwexmvig5pxFTMkqoLllaSZa/5ewgAoA4QEgrgXqXc9ELvbs1iItVNMCh4RgW1GzWoAaHEXV3lJjzwFeiqXD1OAjXUrjmzMw70MbrqFI5WBaTUKUbnDcW4TUTpIugcmBjg5wliRblb0gSoMO1ApxKkWrzXadmtrl6K98UN/takaLJMEGmFMtHmtMRHXCma8kXWd0cN5L7HHtdPIIJ1fAlFevcDcrFJ2JmPFYdVimTJOnQFZq45S9Xeb1tbettU6+a9WqnemLeX6ffl483BcjFdN01eyFFVHK0/FxO/9H/ezlUKYH7AAAAAElFTkSuQmCC) no-repeat center;
170
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAACXBIWXMAAA86AAAPOgGXOdvCAAABVklEQVQoFS2RO1IEMQxEJY+zzSDZlCNwAQIOxJm4DReAnICIIuFTW7U7lsxreTUzHltqtVqyPzw/HQ+3Oaebpc16EospszJ+OfP7/NePh5vHu/sRMfHw2RwxLjHOcQnlJHg42L9+vncIImOPQTbQOXPPHBmRE3o5RQMZwexmvig5pxFTMkqoLllaSZa/5ewgAoA4QEgrgXqXc9ELvbs1iItVNMCh4RgW1GzWoAaHEXV3lJjzwFeiqXD1OAjXUrjmzMw70MbrqFI5WBaTUKUbnDcW4TUTpIugcmBjg5wliRblb0gSoMO1ApxKkWrzXadmtrl6K98UN/takaLJMEGmFMtHmtMRHXCma8kXWd0cN5L7HHtdPIIJ1fAlFevcDcrFJ2JmPFYdVimTJOnQFZq45S9Xeb1tbettU6+a9WqnemLeX6ffl483BcjFdN01eyFFVHK0/FxO/9H/ezlUKYH7AAAAAElFTkSuQmCC) no-repeat center;
159
171
 
160
172
  }
161
173
 
162
174
  .invalid {
163
- margin: 0px auto 10px auto;
175
+ margin: 0px auto 10px auto;
164
176
  width: 15px;
165
177
  height: 15px;
166
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAACXBIWXMAAA86AAAPOgGXOdvCAAABWUlEQVQoFS2SvVEEMQyFJdkspFcCVAAVUREZXVAHHRAwZOQwQ3YM67X4nnwe3+3afn+S18/P9366s5yZ042R6c3c3bRKDw+WwZxf791Pt/3hMcev5QBpFtauPLoBYrYr6zcem/Xr8frUbc4c59zPPoekQeSesTm47IaD74kfTjnDbNqxC5pTzrJfQcCFBQClIh7bIdDc9S+6E8WIQXTl9somfA1S4iJVbUnJmyOhJT+51AMRkXVArMtBdUNLGcpmaReDdSIGHw4m2iyNIiMslTWqBvMuZSVZB4QhMRRp6IUjzYuPctvq3TpWumq2sIfNw/KQ3DwomfIv6aVBT+ZQMFKxhB8uLfhlzkO3Sstlwh1ja3+oEKVuqipGHhMztEGvvlZEQHwyMKPD1NDtrrpBR3jbalv90hWzo05FBr1vlKGXtvGF9fz5HG8vFRpK1a5yV0/KVuZSzO+Pf3G6tVs/+L00AAAAAElFTkSuQmCC) no-repeat center;
178
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAACXBIWXMAAA86AAAPOgGXOdvCAAABWUlEQVQoFS2SvVEEMQyFJdkspFcCVAAVUREZXVAHHRAwZOQwQ3YM67X4nnwe3+3afn+S18/P9366s5yZ042R6c3c3bRKDw+WwZxf791Pt/3hMcev5QBpFtauPLoBYrYr6zcem/Xr8frUbc4c59zPPoekQeSesTm47IaD74kfTjnDbNqxC5pTzrJfQcCFBQClIh7bIdDc9S+6E8WIQXTl9somfA1S4iJVbUnJmyOhJT+51AMRkXVArMtBdUNLGcpmaReDdSIGHw4m2iyNIiMslTWqBvMuZSVZB4QhMRRp6IUjzYuPctvq3TpWumq2sIfNw/KQ3DwomfIv6aVBT+ZQMFKxhB8uLfhlzkO3Sstlwh1ja3+oEKVuqipGHhMztEGvvlZEQHwyMKPD1NDtrrpBR3jbalv90hWzo05FBr1vlKGXtvGF9fz5HG8vFRpK1a5yV0/KVuZSzO+Pf3G6tVs/+L00AAAAAElFTkSuQmCC) no-repeat center;
167
179
  }
168
180
 
169
181
  .conflicted {}
@@ -1,20 +1,23 @@
1
- <li>
1
+ <% n = 1 %>
2
+ <li class="r<%= n %>">
2
3
  <%= linkify YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE, "All Features" %>
3
4
  </li>
5
+ <% n = n == 2 ? 1 : 2 %>
4
6
  <% @items.each do |feature| %>
5
- <li>
7
+ <li class="r<%= n %>">
6
8
  <%= "<a class='toggle'></a>" unless feature.scenarios.empty? %>
7
9
  <%= linkify feature, feature.value %>
8
10
  <small><%= feature.location %></small>
9
11
  </li>
10
-
12
+ <% n = n == 2 ? 1 : 2 %>
11
13
  <% if feature.scenarios %>
12
14
  <ul>
13
15
  <% feature.scenarios.each do |scenario| %>
14
- <li>
16
+ <li class="r<%= n %>">
15
17
  <%= linkify feature, scenario.value %>
16
18
  <small><%= scenario.location %></small>
17
19
  </li>
20
+ <% n = n == 2 ? 1 : 2 %>
18
21
  <% end %>
19
22
  </ul>
20
23
  <% end %>
@@ -1,14 +1,16 @@
1
1
  function cucumberSearchFrameLinks() {
2
- $('#feature_list_link').click(function() {
2
+ $('#features_list_link').click(function() {
3
3
  toggleSearchFrame(this, relpath + 'feature_list.html');
4
4
  });
5
- $('#tagusage_list_link').click(function() {
5
+ $('#tags_list_link').click(function() {
6
6
  toggleSearchFrame(this, relpath + 'tag_list.html');
7
7
  });
8
8
  }
9
9
 
10
10
  $(cucumberSearchFrameLinks);
11
11
 
12
+
13
+
12
14
  function toggleScenarioExample(id,example) {
13
15
 
14
16
  var element = $("#" + id + "Example" + example + "Steps")[0];
@@ -30,3 +32,55 @@ function toggleScenarioExample(id,example) {
30
32
  element.style.display = 'block';
31
33
 
32
34
  }
35
+
36
+ function determine_tags_used_in_formula(tag_string) {
37
+ //$("#tag_debug")[0].innerHTML = "";
38
+
39
+ tag_string = tag_string.replace(/^(\s+)|(\s+)$/,'').replace(/\s{2,}/,' ');
40
+
41
+ var tags = tag_string.match(/@\w+/g);
42
+
43
+ var return_tags = [];
44
+
45
+ if (tags != null) {
46
+ tags.forEach(function(tag, index, array) {
47
+ //$("#tag_debug")[0].innerHTML += tag + " ";
48
+ if (tag_list.indexOf(tag) != -1) {
49
+ return_tags.push(tag);
50
+ }
51
+ });
52
+ }
53
+
54
+ return return_tags;
55
+ }
56
+
57
+
58
+ function display_example_command_line(tags) {
59
+ $("#command_example")[0].innerHTML = "cucumber ";
60
+
61
+ if (tags.length > 0) {
62
+ $("#command_example")[0].innerHTML += "--tags " + tags.join(" --tags ");
63
+ }
64
+ }
65
+
66
+ function display_qualifying_features_and_scenarios(tags) {
67
+ //$("#tag_debug")[0].innerHTML = "";
68
+
69
+ if (tags.length > 0) {
70
+
71
+ $(".feature,.scenario").each(function(feature){
72
+ this.style.display = "none";
73
+ });
74
+
75
+ $(".feature.\\" + tags.join(".\\") + ",.scenario.\\" + tags.join(".\\")).each(function(feature) {
76
+ //$("#tag_debug")[0].innerHTML += feature + " " + this;
77
+ this.style.display = "block";
78
+ });
79
+
80
+ } else {
81
+ $(".feature,.scenario").each(function(feature){
82
+ this.style.display = "block";
83
+ });
84
+ }
85
+
86
+ }
@@ -1,6 +1,6 @@
1
1
  <div id="search">
2
- <a id="feature_list_link" href="#">Features</a>
3
- <a id="tagusage_list_link" href="#">Tags</a>
2
+ <a id="features_list_link" href="#">Features</a>
3
+ <a id="tags_list_link" href="#">Tags</a>
4
4
  <a id="class_list_link" href="#">Class List</a>
5
5
  <a id="method_list_link" href="#">Method List</a>
6
6
  <a id ="file_list_link" href="#">File List</a>
@@ -18,7 +18,7 @@
18
18
  <div class="tags"><span class="name">Tags:</span>
19
19
  <%= tags.collect {|tag| linkify(tag,tag.value) }.join(",\n") %>
20
20
  </div>
21
-
21
+
22
22
  <% if features && !features.empty? %>
23
23
  <div id="features" style="margin-left: 40px;">
24
24
  <div class="title"><span class="name">Features</span></div>
@@ -36,7 +36,7 @@
36
36
  <li class="letter"><%= letter %></li>
37
37
  <ul>
38
38
  <% objects.each do |obj| %>
39
- <li>
39
+ <li class="feature <%= obj.tags.map{|t| t.value }.join(" ") %>">
40
40
  <%= linkify obj, obj.value %>
41
41
  <small>(<%= obj.file %>)</small>
42
42
  </li>
@@ -50,7 +50,8 @@
50
50
  <% else %>
51
51
  <!-- No Features Defined -->
52
52
  <% end %>
53
-
53
+
54
+
54
55
  <% if feature_directories && !feature_directories.empty? %>
55
56
  <div id="directory" style="margin-left: 40px;">
56
57
  <div class="title"><span class="name">Subdirectories</span></div>
@@ -17,6 +17,14 @@ def all_features_by_letter
17
17
  hash
18
18
  end
19
19
 
20
+ def all_scenarios_by_letter
21
+ hash = {}
22
+ objects = scenarios
23
+ objects = run_verifier(objects)
24
+ objects.each {|o| (hash[o.value.to_s[0,1].upcase] ||= []) << o }
25
+ hash
26
+ end
27
+
20
28
  def all_directories_by_letter
21
29
  hash = {}
22
30
  objects = feature_directories
@@ -34,7 +42,7 @@ def features
34
42
  end
35
43
 
36
44
  def scenarios
37
- @scenarios ||= Registry.all(:scenario)
45
+ @scenarios ||= Registry.all(:scenario).reject {|s| s.background? }
38
46
  end
39
47
 
40
48
  def steps
@@ -0,0 +1,7 @@
1
+ <div style="margin: 10px;">&nbsp;</div>
2
+
3
+ <div class="title">
4
+ <div class="name"><%= @item_title %></div>
5
+ </div>
6
+
7
+ <div style="margin: 10px;">&nbsp;</div>
@@ -1,12 +1,3 @@
1
-
2
- <div style="margin: 10px;">&nbsp;</div>
3
-
4
- <div class="title">
5
- <div class="name"><%= @item_title %></div>
6
- </div>
7
-
8
- <div style="margin: 10px;">&nbsp;</div>
9
-
10
1
  <% @items.each do |item| %>
11
2
 
12
3
  <div class="stepdef">
@@ -16,7 +7,9 @@
16
7
  <span class="name"><%= item.value %></span>
17
8
  <div style="float: right;"><%= h( item.location ) %></div>
18
9
  </div>
19
-
10
+ <div>
11
+ <%= T('docstring').run(options.dup.merge({:object => item})) %>
12
+ </div>
20
13
  <div class="method_details_list">
21
14
  <table class="source_code">
22
15
  <tr>
@@ -1,12 +1,3 @@
1
-
2
- <div style="margin: 10px;">&nbsp;</div>
3
-
4
- <div id="undefined_steps" class="title">
5
- <div class="name">Undefined Steps</div>
6
- </div>
7
-
8
- <div style="margin: 10px;">&nbsp;</div>
9
-
10
1
  <div class="stepdef">
11
2
  <div class="steps">
12
3
  <% if @undefined_steps && !@undefined_steps.empty? %>
@@ -8,19 +8,21 @@ def stepdefinitions
8
8
  @item_title = "Step Definitions"
9
9
  @item_type = "step definition"
10
10
  @items = YARD::Registry.all(:stepdefinition)
11
- erb(:transformers)
11
+ erb(:header) + erb(:transformers)
12
12
  end
13
13
 
14
14
  def steptransforms
15
15
  @item_title = "Step Transforms"
16
16
  @item_type = "step transform"
17
17
  @items = YARD::Registry.all(:steptransform)
18
- erb(:transformers)
18
+ erb(:header) + erb(:transformers)
19
19
  end
20
20
 
21
21
  def undefined_steps
22
+ @item_title = "Undefined Steps"
23
+ @item_type = "undefined steps"
22
24
  @undefined_steps ||= Registry.all(:step).reject {|s| s.definition || s.scenario.outline? }
23
- erb(:undefined_steps)
25
+ erb(:header) + erb(:undefined_steps)
24
26
  end
25
27
 
26
28
 
@@ -0,0 +1,25 @@
1
+ module YARD
2
+ module Server
3
+ module Commands
4
+
5
+ class ListFeaturesCommand < ListCommand
6
+ def type; :features end
7
+
8
+ def items
9
+ Registry.load_all
10
+ run_verifier(Registry.all(:feature))
11
+ end
12
+ end
13
+
14
+ class ListTagsCommand < ListCommand
15
+ def type; :tags end
16
+
17
+ def items
18
+ Registry.load_all
19
+ run_verifier(Registry.all(:tag).sort_by {|t| t.value.to_s })
20
+ end
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,31 @@
1
+ module YARD
2
+ module Server
3
+
4
+ #
5
+ # The YARD::Server::Router needs the following modification,
6
+ # otherwise it perfectly suited for the requirements documents
7
+ #
8
+ Router.class_eval do
9
+
10
+ alias_method :core_route_list, :route_list
11
+
12
+ #
13
+ # Provide the full list of features and tags
14
+ #
15
+ def route_list(library, paths)
16
+
17
+ if paths && !paths.empty? && paths.first =~ /^(?:features|tags)$/
18
+ case paths.shift
19
+ when "features"; cmd = Commands::ListFeaturesCommand
20
+ when "tags"; cmd = Commands::ListTagsCommand
21
+ end
22
+ cmd.new(final_options(library, paths)).call(request)
23
+ else
24
+ core_route_list(library,paths)
25
+ end
26
+
27
+ end
28
+
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-in-the-yard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
- - 3
10
- version: 1.6.3
9
+ - 4
10
+ version: 1.6.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Franklin Webber
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-08 00:00:00 -08:00
18
+ date: 2010-11-16 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -58,12 +58,12 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- hash: 5
61
+ hash: 3
62
62
  segments:
63
63
  - 0
64
64
  - 6
65
- - 1
66
- version: 0.6.1
65
+ - 2
66
+ version: 0.6.2
67
67
  type: :runtime
68
68
  version_requirements: *id003
69
69
  description: " \n Cucumber-In-The-Yard is a YARD extension that processes Cucumber Features, Scenarios, Steps,\n Step Definitions, Transforms, and Tags and provides a documentation interface that allows you\n easily view and investigate the test suite. This tools hopes to bridge the gap of being able\n to provide your feature descriptions to your Product Owners and Stakeholders. "
@@ -94,6 +94,10 @@ files:
94
94
  - example/transform.feature
95
95
  - lib/city.rb
96
96
  - lib/cucumber/city_builder.rb
97
+ - lib/docserver/default/fulldoc/html/js/cucumber.js
98
+ - lib/docserver/default/layout/html/headers.erb
99
+ - lib/docserver/doc_server/full_list/html/full_list.erb
100
+ - lib/docserver/doc_server/full_list/html/setup.rb
97
101
  - lib/templates/default/feature/html/background.erb
98
102
  - lib/templates/default/feature/html/feature.erb
99
103
  - lib/templates/default/feature/html/no_steps_defined.erb
@@ -122,6 +126,7 @@ files:
122
126
  - lib/templates/default/requirements/html/setup.rb
123
127
  - lib/templates/default/scenario/html/scenario.erb
124
128
  - lib/templates/default/scenario/setup.rb
129
+ - lib/templates/default/steptransformers/html/header.erb
125
130
  - lib/templates/default/steptransformers/html/steptransformers.erb
126
131
  - lib/templates/default/steptransformers/html/transformers.erb
127
132
  - lib/templates/default/steptransformers/html/undefined_steps.erb
@@ -148,6 +153,8 @@ files:
148
153
  - lib/yard/parser/cucumber/feature.rb
149
154
  - lib/yard/parser/source_parser.rb
150
155
  - lib/yard/rake/city_task.rb
156
+ - lib/yard/server/commands/list_command.rb
157
+ - lib/yard/server/router.rb
151
158
  - lib/yard/templates/helpers/base_helper.rb
152
159
  has_rdoc: true
153
160
  homepage: http://github.com/burtlo/Cucumber-In-The-Yard
@@ -157,11 +164,15 @@ post_install_message: |+
157
164
 
158
165
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
159
166
 
160
- Thank you for installing Cucumber-In-The-YARD 1.6.3 / 2010-11-08.
167
+ Thank you for installing Cucumber-In-The-YARD 1.6.4 / 2010-11-16.
161
168
 
162
169
  Changes:
163
170
 
164
- * FIX Step Definitions and Step Transforms incorrectly cached the YARD Constants
171
+ * `yard server` can now serve up requirements with YARD 0.6.2
172
+ * 'All Tags' page now has a cucumber tag AND filtering tool (beta)
173
+ * Step Defs and Transforms will show comments
174
+
175
+ * FIX removed warnings by no longer requiring YARD
165
176
 
166
177
 
167
178
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)