genspec 0.1.1 → 0.2.0.prerails3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +79 -31
- data/Rakefile +69 -22
- data/VERSION +1 -1
- data/genspec.gemspec +31 -40
- data/lib/gen_spec.rb +1 -0
- data/lib/genspec.rb +23 -8
- data/lib/genspec/generator_example_group.rb +47 -52
- data/lib/genspec/matchers.rb +59 -0
- data/lib/genspec/matchers/base.rb +148 -0
- data/lib/genspec/matchers/generation_method_matcher.rb +88 -0
- data/lib/genspec/matchers/output_matcher.rb +34 -0
- data/lib/genspec/matchers/result_matcher.rb +28 -0
- data/lib/genspec/shell.rb +99 -0
- data/pkg/genspec-0.1.1.gem +0 -0
- data/pkg/genspec-0.2.0.pre1.gem +0 -0
- data/pkg/genspec-0.2.0.prerails3.1.gem +0 -0
- data/spec/generators/test_rails3_spec.rb +74 -0
- data/spec/rcov.opts +2 -0
- data/spec/rspec.opts +2 -0
- data/spec/spec_helper.rb +10 -3
- data/spec/support/generators/test_rails3/USAGE +8 -0
- data/spec/support/generators/{test → test_rails3}/templates/file +0 -0
- data/spec/support/generators/test_rails3/test_rails3_generator.rb +23 -0
- metadata +48 -40
- data/lib/genspec/generation_matchers.rb +0 -27
- data/lib/genspec/generation_matchers/generation_matcher.rb +0 -147
- data/lib/genspec/generation_matchers/result_matcher.rb +0 -42
- data/pkg/genspec-0.0.0.gem +0 -0
- data/pkg/genspec-0.1.0.gem +0 -0
- data/rdoc/classes/GenSpec.html +0 -124
- data/rdoc/classes/GenSpec/GenerationMatchers.html +0 -197
- data/rdoc/classes/GenSpec/GenerationMatchers/GenerationMatcher.html +0 -363
- data/rdoc/classes/GenSpec/GenerationMatchers/ResultMatcher.html +0 -241
- data/rdoc/classes/GenSpec/GeneratorExampleGroup.html +0 -285
- data/rdoc/created.rid +0 -1
- data/rdoc/files/README_rdoc.html +0 -261
- data/rdoc/files/lib/genspec/generation_matchers/generation_matcher_rb.html +0 -101
- data/rdoc/files/lib/genspec/generation_matchers/result_matcher_rb.html +0 -101
- data/rdoc/files/lib/genspec/generation_matchers_rb.html +0 -109
- data/rdoc/files/lib/genspec/generator_example_group_rb.html +0 -101
- data/rdoc/files/lib/genspec_rb.html +0 -114
- data/rdoc/fr_class_index.html +0 -31
- data/rdoc/fr_file_index.html +0 -32
- data/rdoc/fr_method_index.html +0 -46
- data/rdoc/index.html +0 -26
- data/rdoc/rdoc-style.css +0 -208
- data/spec/generators/test_spec.rb +0 -96
- data/spec/support/generators/test/test_generator.rb +0 -29
@@ -1,241 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: GenSpec::GenerationMatchers::ResultMatcher</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">GenSpec::GenerationMatchers::ResultMatcher</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../files/lib/genspec/generation_matchers/result_matcher_rb.html">
|
59
|
-
lib/genspec/generation_matchers/result_matcher.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="GenerationMatcher.html">
|
69
|
-
GenSpec::GenerationMatchers::GenerationMatcher
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
<div id="method-list">
|
88
|
-
<h3 class="section-bar">Methods</h3>
|
89
|
-
|
90
|
-
<div class="name-list">
|
91
|
-
<a href="#M000004">after_replay</a>
|
92
|
-
<a href="#M000005">failure_message</a>
|
93
|
-
<a href="#M000006">negative_failure_message</a>
|
94
|
-
<a href="#M000003">new</a>
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
|
98
|
-
</div>
|
99
|
-
|
100
|
-
|
101
|
-
<!-- if includes -->
|
102
|
-
|
103
|
-
<div id="section">
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
<div id="attribute-list">
|
110
|
-
<h3 class="section-bar">Attributes</h3>
|
111
|
-
|
112
|
-
<div class="name-list">
|
113
|
-
<table>
|
114
|
-
<tr class="top-aligned-row context-row">
|
115
|
-
<td class="context-item-name">filename</td>
|
116
|
-
<td class="context-item-value"> [R] </td>
|
117
|
-
<td class="context-item-desc"></td>
|
118
|
-
</tr>
|
119
|
-
</table>
|
120
|
-
</div>
|
121
|
-
</div>
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
<!-- if method_list -->
|
126
|
-
<div id="methods">
|
127
|
-
<h3 class="section-bar">Public Class methods</h3>
|
128
|
-
|
129
|
-
<div id="method-M000003" class="method-detail">
|
130
|
-
<a name="M000003"></a>
|
131
|
-
|
132
|
-
<div class="method-heading">
|
133
|
-
<a href="#M000003" class="method-signature">
|
134
|
-
<span class="method-name">new</span><span class="method-args">(filename, &block)</span>
|
135
|
-
</a>
|
136
|
-
</div>
|
137
|
-
|
138
|
-
<div class="method-description">
|
139
|
-
<p><a class="source-toggle" href="#"
|
140
|
-
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
141
|
-
<div class="method-source-code" id="M000003-source">
|
142
|
-
<pre>
|
143
|
-
<span class="ruby-comment cmt"># File lib/genspec/generation_matchers/result_matcher.rb, line 6</span>
|
144
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
145
|
-
<span class="ruby-ivar">@filename</span> = <span class="ruby-identifier">filename</span>
|
146
|
-
<span class="ruby-ivar">@block</span> = <span class="ruby-identifier">block</span>
|
147
|
-
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">:does_not_matter</span>)
|
148
|
-
<span class="ruby-keyword kw">end</span>
|
149
|
-
</pre>
|
150
|
-
</div>
|
151
|
-
</div>
|
152
|
-
</div>
|
153
|
-
|
154
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
155
|
-
|
156
|
-
<div id="method-M000004" class="method-detail">
|
157
|
-
<a name="M000004"></a>
|
158
|
-
|
159
|
-
<div class="method-heading">
|
160
|
-
<a href="#M000004" class="method-signature">
|
161
|
-
<span class="method-name">after_replay</span><span class="method-args">(target)</span>
|
162
|
-
</a>
|
163
|
-
</div>
|
164
|
-
|
165
|
-
<div class="method-description">
|
166
|
-
<p><a class="source-toggle" href="#"
|
167
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
168
|
-
<div class="method-source-code" id="M000004-source">
|
169
|
-
<pre>
|
170
|
-
<span class="ruby-comment cmt"># File lib/genspec/generation_matchers/result_matcher.rb, line 12</span>
|
171
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">after_replay</span>(<span class="ruby-identifier">target</span>)
|
172
|
-
<span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>.<span class="ruby-identifier">destination_root</span>, <span class="ruby-identifier">filename</span>)
|
173
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">path</span>)
|
174
|
-
<span class="ruby-identifier">matched!</span>
|
175
|
-
<span class="ruby-identifier">validate_block</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">path</span>)
|
176
|
-
<span class="ruby-keyword kw">end</span>
|
177
|
-
<span class="ruby-keyword kw">end</span>
|
178
|
-
</pre>
|
179
|
-
</div>
|
180
|
-
</div>
|
181
|
-
</div>
|
182
|
-
|
183
|
-
<div id="method-M000005" class="method-detail">
|
184
|
-
<a name="M000005"></a>
|
185
|
-
|
186
|
-
<div class="method-heading">
|
187
|
-
<a href="#M000005" class="method-signature">
|
188
|
-
<span class="method-name">failure_message</span><span class="method-args">()</span>
|
189
|
-
</a>
|
190
|
-
</div>
|
191
|
-
|
192
|
-
<div class="method-description">
|
193
|
-
<p><a class="source-toggle" href="#"
|
194
|
-
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
195
|
-
<div class="method-source-code" id="M000005-source">
|
196
|
-
<pre>
|
197
|
-
<span class="ruby-comment cmt"># File lib/genspec/generation_matchers/result_matcher.rb, line 20</span>
|
198
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">failure_message</span>
|
199
|
-
<span class="ruby-node">"Expected to generate file #{filename}"</span>
|
200
|
-
<span class="ruby-keyword kw">end</span>
|
201
|
-
</pre>
|
202
|
-
</div>
|
203
|
-
</div>
|
204
|
-
</div>
|
205
|
-
|
206
|
-
<div id="method-M000006" class="method-detail">
|
207
|
-
<a name="M000006"></a>
|
208
|
-
|
209
|
-
<div class="method-heading">
|
210
|
-
<a href="#M000006" class="method-signature">
|
211
|
-
<span class="method-name">negative_failure_message</span><span class="method-args">()</span>
|
212
|
-
</a>
|
213
|
-
</div>
|
214
|
-
|
215
|
-
<div class="method-description">
|
216
|
-
<p><a class="source-toggle" href="#"
|
217
|
-
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
218
|
-
<div class="method-source-code" id="M000006-source">
|
219
|
-
<pre>
|
220
|
-
<span class="ruby-comment cmt"># File lib/genspec/generation_matchers/result_matcher.rb, line 24</span>
|
221
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">negative_failure_message</span>
|
222
|
-
<span class="ruby-node">"Expected to not generate file #{filename}"</span>
|
223
|
-
<span class="ruby-keyword kw">end</span>
|
224
|
-
</pre>
|
225
|
-
</div>
|
226
|
-
</div>
|
227
|
-
</div>
|
228
|
-
|
229
|
-
|
230
|
-
</div>
|
231
|
-
|
232
|
-
|
233
|
-
</div>
|
234
|
-
|
235
|
-
|
236
|
-
<div id="validator-badges">
|
237
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
238
|
-
</div>
|
239
|
-
|
240
|
-
</body>
|
241
|
-
</html>
|
@@ -1,285 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: GenSpec::GeneratorExampleGroup</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">GenSpec::GeneratorExampleGroup</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/genspec/generator_example_group_rb.html">
|
59
|
-
lib/genspec/generator_example_group.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div id="method-list">
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
87
|
-
|
88
|
-
<div class="name-list">
|
89
|
-
<a href="#M000016">generator_arguments</a>
|
90
|
-
<a href="#M000017">generator_options</a>
|
91
|
-
<a href="#M000020">subject</a>
|
92
|
-
<a href="#M000018">with_arguments</a>
|
93
|
-
<a href="#M000019">with_options</a>
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
</div>
|
98
|
-
|
99
|
-
|
100
|
-
<!-- if includes -->
|
101
|
-
<div id="includes">
|
102
|
-
<h3 class="section-bar">Included Modules</h3>
|
103
|
-
|
104
|
-
<div id="includes-list">
|
105
|
-
<span class="include-name">Spec::Example::ExampleMethods</span>
|
106
|
-
<span class="include-name"><a href="GenerationMatchers.html">GenSpec::GenerationMatchers</a></span>
|
107
|
-
</div>
|
108
|
-
</div>
|
109
|
-
|
110
|
-
<div id="section">
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
<div id="aliases-list">
|
115
|
-
<h3 class="section-bar">External Aliases</h3>
|
116
|
-
|
117
|
-
<div class="name-list">
|
118
|
-
<table summary="aliases">
|
119
|
-
<tr class="top-aligned-row context-row">
|
120
|
-
<td class="context-item-name">generator_arguments</td>
|
121
|
-
<td>-></td>
|
122
|
-
<td class="context-item-value">generator_args</td>
|
123
|
-
</tr>
|
124
|
-
<tr class="top-aligned-row context-row">
|
125
|
-
<td class="context-item-name">with_arguments</td>
|
126
|
-
<td>-></td>
|
127
|
-
<td class="context-item-value">with_args</td>
|
128
|
-
</tr>
|
129
|
-
</table>
|
130
|
-
</div>
|
131
|
-
</div>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
<!-- if method_list -->
|
138
|
-
<div id="methods">
|
139
|
-
<h3 class="section-bar">Public Class methods</h3>
|
140
|
-
|
141
|
-
<div id="method-M000016" class="method-detail">
|
142
|
-
<a name="M000016"></a>
|
143
|
-
|
144
|
-
<div class="method-heading">
|
145
|
-
<a href="#M000016" class="method-signature">
|
146
|
-
<span class="method-name">generator_arguments</span><span class="method-args">()</span>
|
147
|
-
</a>
|
148
|
-
</div>
|
149
|
-
|
150
|
-
<div class="method-description">
|
151
|
-
<p><a class="source-toggle" href="#"
|
152
|
-
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
153
|
-
<div class="method-source-code" id="M000016-source">
|
154
|
-
<pre>
|
155
|
-
<span class="ruby-comment cmt"># File lib/genspec/generator_example_group.rb, line 9</span>
|
156
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generator_arguments</span>
|
157
|
-
<span class="ruby-ivar">@generator_args</span>.<span class="ruby-identifier">dup?</span> <span class="ruby-operator">||</span> []
|
158
|
-
<span class="ruby-keyword kw">end</span>
|
159
|
-
</pre>
|
160
|
-
</div>
|
161
|
-
</div>
|
162
|
-
</div>
|
163
|
-
|
164
|
-
<div id="method-M000017" class="method-detail">
|
165
|
-
<a name="M000017"></a>
|
166
|
-
|
167
|
-
<div class="method-heading">
|
168
|
-
<a href="#M000017" class="method-signature">
|
169
|
-
<span class="method-name">generator_options</span><span class="method-args">()</span>
|
170
|
-
</a>
|
171
|
-
</div>
|
172
|
-
|
173
|
-
<div class="method-description">
|
174
|
-
<p><a class="source-toggle" href="#"
|
175
|
-
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
176
|
-
<div class="method-source-code" id="M000017-source">
|
177
|
-
<pre>
|
178
|
-
<span class="ruby-comment cmt"># File lib/genspec/generator_example_group.rb, line 13</span>
|
179
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generator_options</span>
|
180
|
-
<span class="ruby-ivar">@generator_options</span>.<span class="ruby-identifier">dup?</span> <span class="ruby-operator">||</span> {}
|
181
|
-
<span class="ruby-keyword kw">end</span>
|
182
|
-
</pre>
|
183
|
-
</div>
|
184
|
-
</div>
|
185
|
-
</div>
|
186
|
-
|
187
|
-
<div id="method-M000018" class="method-detail">
|
188
|
-
<a name="M000018"></a>
|
189
|
-
|
190
|
-
<div class="method-heading">
|
191
|
-
<a href="#M000018" class="method-signature">
|
192
|
-
<span class="method-name">with_arguments</span><span class="method-args">(*args, &block)</span>
|
193
|
-
</a>
|
194
|
-
</div>
|
195
|
-
|
196
|
-
<div class="method-description">
|
197
|
-
<p><a class="source-toggle" href="#"
|
198
|
-
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
199
|
-
<div class="method-source-code" id="M000018-source">
|
200
|
-
<pre>
|
201
|
-
<span class="ruby-comment cmt"># File lib/genspec/generator_example_group.rb, line 17</span>
|
202
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_arguments</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
203
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
204
|
-
<span class="ruby-identifier">context</span> <span class="ruby-node">"with arguments #{args.inspect}"</span> <span class="ruby-keyword kw">do</span>
|
205
|
-
<span class="ruby-identifier">with_arguments</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
206
|
-
<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
207
|
-
<span class="ruby-keyword kw">end</span>
|
208
|
-
<span class="ruby-keyword kw">else</span>
|
209
|
-
<span class="ruby-ivar">@generator_args</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span> }
|
210
|
-
<span class="ruby-keyword kw">end</span>
|
211
|
-
<span class="ruby-keyword kw">end</span>
|
212
|
-
</pre>
|
213
|
-
</div>
|
214
|
-
</div>
|
215
|
-
</div>
|
216
|
-
|
217
|
-
<div id="method-M000019" class="method-detail">
|
218
|
-
<a name="M000019"></a>
|
219
|
-
|
220
|
-
<div class="method-heading">
|
221
|
-
<a href="#M000019" class="method-signature">
|
222
|
-
<span class="method-name">with_options</span><span class="method-args">(hash, &block)</span>
|
223
|
-
</a>
|
224
|
-
</div>
|
225
|
-
|
226
|
-
<div class="method-description">
|
227
|
-
<p><a class="source-toggle" href="#"
|
228
|
-
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
229
|
-
<div class="method-source-code" id="M000019-source">
|
230
|
-
<pre>
|
231
|
-
<span class="ruby-comment cmt"># File lib/genspec/generator_example_group.rb, line 28</span>
|
232
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_options</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
233
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
234
|
-
<span class="ruby-identifier">context</span> <span class="ruby-node">"with options #{hash.inspect}"</span> <span class="ruby-keyword kw">do</span>
|
235
|
-
<span class="ruby-identifier">with_options</span>(<span class="ruby-identifier">hash</span>)
|
236
|
-
<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
237
|
-
<span class="ruby-keyword kw">end</span>
|
238
|
-
<span class="ruby-keyword kw">else</span>
|
239
|
-
<span class="ruby-ivar">@generator_options</span> = <span class="ruby-identifier">hash</span>
|
240
|
-
<span class="ruby-keyword kw">end</span>
|
241
|
-
<span class="ruby-keyword kw">end</span>
|
242
|
-
</pre>
|
243
|
-
</div>
|
244
|
-
</div>
|
245
|
-
</div>
|
246
|
-
|
247
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
248
|
-
|
249
|
-
<div id="method-M000020" class="method-detail">
|
250
|
-
<a name="M000020"></a>
|
251
|
-
|
252
|
-
<div class="method-heading">
|
253
|
-
<a href="#M000020" class="method-signature">
|
254
|
-
<span class="method-name">subject</span><span class="method-args">(&block)</span>
|
255
|
-
</a>
|
256
|
-
</div>
|
257
|
-
|
258
|
-
<div class="method-description">
|
259
|
-
<p><a class="source-toggle" href="#"
|
260
|
-
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
261
|
-
<div class="method-source-code" id="M000020-source">
|
262
|
-
<pre>
|
263
|
-
<span class="ruby-comment cmt"># File lib/genspec/generator_example_group.rb, line 43</span>
|
264
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">subject</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
265
|
-
<span class="ruby-identifier">block</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-value">?
|
266
|
-
</span> <span class="ruby-identifier">explicit_subject</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">implicit_subject</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@explicit_subject_block</span> = <span class="ruby-identifier">block</span>
|
267
|
-
<span class="ruby-keyword kw">end</span>
|
268
|
-
</pre>
|
269
|
-
</div>
|
270
|
-
</div>
|
271
|
-
</div>
|
272
|
-
|
273
|
-
|
274
|
-
</div>
|
275
|
-
|
276
|
-
|
277
|
-
</div>
|
278
|
-
|
279
|
-
|
280
|
-
<div id="validator-badges">
|
281
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
282
|
-
</div>
|
283
|
-
|
284
|
-
</body>
|
285
|
-
</html>
|