knife-github 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.yardopts +1 -0
- data/LICENSE +201 -201
- data/Rakefile +5 -0
- data/doc/Chef.html +132 -0
- data/doc/Chef/Knife.html +138 -0
- data/doc/Chef/Knife/GithubBase.html +784 -0
- data/doc/Chef/Knife/GithubBaseList.html +316 -0
- data/doc/Chef/Knife/GithubClone.html +341 -0
- data/doc/Chef/Knife/GithubCompare.html +299 -0
- data/doc/Chef/Knife/GithubDeploy.html +1449 -0
- data/doc/Chef/Knife/GithubDiff.html +473 -0
- data/doc/Chef/Knife/GithubList.html +299 -0
- data/doc/KnifeGithubCleanup.html +115 -0
- data/doc/KnifeGithubCleanup/GithubCleanup.html +425 -0
- data/doc/KnifeGithubSearch.html +115 -0
- data/doc/KnifeGithubSearch/GithubSearch.html +325 -0
- data/doc/_index.html +206 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.README.html +118 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +118 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +197 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/chef/knife/github_base.rb +4 -4
- data/lib/chef/knife/github_baselist.rb +6 -3
- data/lib/chef/knife/github_cleanup.rb +1 -1
- data/lib/chef/knife/{github_download.rb → github_clone.rb} +8 -8
- data/lib/chef/knife/github_compare.rb +3 -4
- data/lib/chef/knife/github_deploy.rb +89 -67
- data/lib/chef/knife/github_diff.rb +50 -20
- data/lib/chef/knife/github_list.rb +1 -1
- data/lib/knife-github/version.rb +1 -1
- metadata +32 -3
@@ -0,0 +1,316 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Chef::Knife::GithubBaseList
|
8
|
+
|
9
|
+
— Knife Github utilities
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (G)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Chef.html" title="Chef (class)">Chef</a></span></span> » <span class='title'><span class='object_link'><a href="../Knife.html" title="Chef::Knife (class)">Knife</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">GithubBaseList</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Chef::Knife::GithubBaseList
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/chef/knife/github_baselist.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<h2>
|
96
|
+
Class Method Summary
|
97
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
98
|
+
</h2>
|
99
|
+
|
100
|
+
<ul class="summary">
|
101
|
+
|
102
|
+
<li class="public ">
|
103
|
+
<span class="summary_signature">
|
104
|
+
|
105
|
+
<a href="#included-class_method" title="included (class method)">+ (Object) <strong>included</strong>(includer) </a>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
</span>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
120
|
+
|
121
|
+
</li>
|
122
|
+
|
123
|
+
|
124
|
+
</ul>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<div id="class_method_details" class="method_details_list">
|
130
|
+
<h2>Class Method Details</h2>
|
131
|
+
|
132
|
+
|
133
|
+
<div class="method_details first">
|
134
|
+
<h3 class="signature first" id="included-class_method">
|
135
|
+
|
136
|
+
+ (<tt>Object</tt>) <strong>included</strong>(includer)
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</h3><table class="source_code">
|
143
|
+
<tr>
|
144
|
+
<td>
|
145
|
+
<pre class="lines">
|
146
|
+
|
147
|
+
|
148
|
+
26
|
149
|
+
27
|
150
|
+
28
|
151
|
+
29
|
152
|
+
30
|
153
|
+
31
|
154
|
+
32
|
155
|
+
33
|
156
|
+
34
|
157
|
+
35
|
158
|
+
36
|
159
|
+
37
|
160
|
+
38
|
161
|
+
39
|
162
|
+
40
|
163
|
+
41
|
164
|
+
42
|
165
|
+
43
|
166
|
+
44
|
167
|
+
45
|
168
|
+
46
|
169
|
+
47
|
170
|
+
48
|
171
|
+
49
|
172
|
+
50
|
173
|
+
51
|
174
|
+
52
|
175
|
+
53
|
176
|
+
54
|
177
|
+
55
|
178
|
+
56
|
179
|
+
57
|
180
|
+
58
|
181
|
+
59
|
182
|
+
60
|
183
|
+
61
|
184
|
+
62
|
185
|
+
63
|
186
|
+
64
|
187
|
+
65
|
188
|
+
66
|
189
|
+
67
|
190
|
+
68
|
191
|
+
69
|
192
|
+
70
|
193
|
+
71
|
194
|
+
72
|
195
|
+
73
|
196
|
+
74
|
197
|
+
75
|
198
|
+
76
|
199
|
+
77
|
200
|
+
78
|
201
|
+
79
|
202
|
+
80
|
203
|
+
81
|
204
|
+
82
|
205
|
+
83
|
206
|
+
84
|
207
|
+
85
|
208
|
+
86
|
209
|
+
87
|
210
|
+
88
|
211
|
+
89
|
212
|
+
90
|
213
|
+
91
|
214
|
+
92
|
215
|
+
93
|
216
|
+
94
|
217
|
+
95
|
218
|
+
96
|
219
|
+
97
|
220
|
+
98
|
221
|
+
99</pre>
|
222
|
+
</td>
|
223
|
+
<td>
|
224
|
+
<pre class="code"><span class="info file"># File 'lib/chef/knife/github_baselist.rb', line 26</span>
|
225
|
+
|
226
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_includer'>includer</span><span class='rparen'>)</span>
|
227
|
+
<span class='id identifier rubyid_includer'>includer</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
|
228
|
+
|
229
|
+
<span class='id identifier rubyid_option'>option</span> <span class='symbol'>:fields</span><span class='comma'>,</span>
|
230
|
+
<span class='symbol'>:long</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>--fields 'NAME, NAME'</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
231
|
+
<span class='symbol'>:description</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The fields to output, comma-separated</span><span class='tstring_end'>"</span></span>
|
232
|
+
|
233
|
+
<span class='id identifier rubyid_option'>option</span> <span class='symbol'>:fieldlist</span><span class='comma'>,</span>
|
234
|
+
<span class='symbol'>:long</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>--fieldlist</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
235
|
+
<span class='symbol'>:description</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The available fields to output/filter</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
236
|
+
<span class='symbol'>:boolean</span> <span class='op'>=></span> <span class='kw'>true</span>
|
237
|
+
|
238
|
+
<span class='id identifier rubyid_option'>option</span> <span class='symbol'>:noheader</span><span class='comma'>,</span>
|
239
|
+
<span class='symbol'>:long</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>--noheader</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
240
|
+
<span class='symbol'>:description</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Removes header from output</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
241
|
+
<span class='symbol'>:boolean</span> <span class='op'>=></span> <span class='kw'>true</span>
|
242
|
+
|
243
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_display_info'>display_info</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='id identifier rubyid_match'>match</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
244
|
+
<span class='id identifier rubyid_object_list'>object_list</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
245
|
+
|
246
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span>
|
247
|
+
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>,</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span> <span class='id identifier rubyid_object_list'>object_list</span> <span class='op'><<</span> <span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_n'>n</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_capitalize'>capitalize</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='comma'>,</span> <span class='symbol'>:bold</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
248
|
+
<span class='kw'>else</span>
|
249
|
+
<span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='id identifier rubyid_object_list'>object_list</span> <span class='op'><<</span> <span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='comma'>,</span> <span class='symbol'>:bold</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
250
|
+
<span class='kw'>end</span>
|
251
|
+
|
252
|
+
<span class='id identifier rubyid_col'>col</span> <span class='op'>=</span> <span class='id identifier rubyid_object_list'>object_list</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span>
|
253
|
+
<span class='id identifier rubyid_object_list'>object_list</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:noheader</span><span class='rbracket'>]</span>
|
254
|
+
|
255
|
+
<span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
256
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span>
|
257
|
+
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>,</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span> <span class='id identifier rubyid_object_list'>object_list</span> <span class='op'><<</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_n'>n</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>n/a</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
258
|
+
<span class='kw'>else</span>
|
259
|
+
<span class='id identifier rubyid_color'>color</span> <span class='op'>=</span> <span class='symbol'>:white</span>
|
260
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:mismatch</span><span class='rbracket'>]</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:all</span><span class='rbracket'>]</span>
|
261
|
+
<span class='id identifier rubyid_matches'>matches</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='semicolon'>;</span> <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_matches'>matches</span> <span class='op'><<</span> <span class='id identifier rubyid_v'>v</span><span class='lbracket'>[</span><span class='id identifier rubyid_m'>m</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='rbrace'>}</span>
|
262
|
+
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_matches'>matches</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='int'>1</span>
|
263
|
+
<span class='id identifier rubyid_color'>color</span> <span class='op'>=</span> <span class='symbol'>:yellow</span>
|
264
|
+
<span class='kw'>end</span>
|
265
|
+
<span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='id identifier rubyid_object_list'>object_list</span> <span class='op'><<</span> <span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>n/a</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
266
|
+
<span class='kw'>end</span>
|
267
|
+
<span class='kw'>end</span>
|
268
|
+
|
269
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='id identifier rubyid_object_list'>object_list</span><span class='comma'>,</span> <span class='symbol'>:uneven_columns_across</span><span class='comma'>,</span> <span class='id identifier rubyid_col'>col</span><span class='rparen'>)</span>
|
270
|
+
<span class='id identifier rubyid_display_object_fields'>display_object_fields</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_locate_config_value'>locate_config_value</span><span class='lparen'>(</span><span class='symbol'>:fieldlist</span><span class='rparen'>)</span>
|
271
|
+
<span class='kw'>end</span>
|
272
|
+
|
273
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_display_object_fields'>display_object_fields</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span>
|
274
|
+
<span class='id identifier rubyid_exit'>exit</span> <span class='int'>1</span> <span class='kw'>if</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
275
|
+
<span class='id identifier rubyid_object_fields'>object_fields</span> <span class='op'>=</span> <span class='lbracket'>[</span>
|
276
|
+
<span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Key</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:bold</span><span class='rparen'>)</span><span class='comma'>,</span>
|
277
|
+
<span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Type</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:bold</span><span class='rparen'>)</span><span class='comma'>,</span>
|
278
|
+
<span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Value</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:bold</span><span class='rparen'>)</span>
|
279
|
+
<span class='rbracket'>]</span>
|
280
|
+
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span>
|
281
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_n'>n</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Hash</span>
|
282
|
+
<span class='id identifier rubyid_n'>n</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
283
|
+
<span class='id identifier rubyid_object_fields'>object_fields</span> <span class='op'><<</span> <span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='symbol'>:yellow</span><span class='comma'>,</span> <span class='symbol'>:bold</span><span class='rparen'>)</span>
|
284
|
+
<span class='id identifier rubyid_object_fields'>object_fields</span> <span class='op'><<</span> <span class='id identifier rubyid_n'>n</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
285
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_n'>n</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
|
286
|
+
<span class='id identifier rubyid_object_fields'>object_fields</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'><Array></span><span class='tstring_end'>'</span></span>
|
287
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_n'>n</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
288
|
+
<span class='id identifier rubyid_object_fields'>object_fields</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'><Hash></span><span class='tstring_end'>'</span></span>
|
289
|
+
<span class='kw'>else</span>
|
290
|
+
<span class='id identifier rubyid_object_fields'>object_fields</span> <span class='op'><<</span> <span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_n'>n</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
291
|
+
<span class='kw'>end</span>
|
292
|
+
<span class='kw'>end</span>
|
293
|
+
<span class='kw'>end</span>
|
294
|
+
<span class='kw'>end</span>
|
295
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
296
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='id identifier rubyid_object_fields'>object_fields</span><span class='comma'>,</span> <span class='symbol'>:uneven_columns_across</span><span class='comma'>,</span> <span class='int'>3</span><span class='rparen'>)</span>
|
297
|
+
<span class='kw'>end</span>
|
298
|
+
<span class='kw'>end</span>
|
299
|
+
<span class='kw'>end</span></pre>
|
300
|
+
</td>
|
301
|
+
</tr>
|
302
|
+
</table>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</div>
|
306
|
+
|
307
|
+
</div>
|
308
|
+
|
309
|
+
<div id="footer">
|
310
|
+
Generated on Wed Oct 30 20:03:34 2013 by
|
311
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
312
|
+
0.8.7.2 (ruby-1.9.3).
|
313
|
+
</div>
|
314
|
+
|
315
|
+
</body>
|
316
|
+
</html>
|
@@ -0,0 +1,341 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Chef::Knife::GithubClone
|
8
|
+
|
9
|
+
— Knife Github utilities
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (G)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Chef.html" title="Chef (class)">Chef</a></span></span> » <span class='title'><span class='object_link'><a href="../Knife.html" title="Chef::Knife (class)">Knife</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">GithubClone</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Chef::Knife::GithubClone
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName"><span class='object_link'><a href="../Knife.html" title="Chef::Knife (class)">Chef::Knife</a></span></span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="../Knife.html" title="Chef::Knife (class)">Chef::Knife</a></span></li>
|
82
|
+
|
83
|
+
<li class="next">Chef::Knife::GithubClone</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/chef/knife/github_clone.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<h2>
|
113
|
+
Instance Method Summary
|
114
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
115
|
+
</h2>
|
116
|
+
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#repo_clone-instance_method" title="#repo_clone (instance method)">- (Object) <strong>repo_clone</strong>(repo, cookbook) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
<li class="public ">
|
142
|
+
<span class="summary_signature">
|
143
|
+
|
144
|
+
<a href="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong> </a>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</span>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
159
|
+
|
160
|
+
</li>
|
161
|
+
|
162
|
+
|
163
|
+
</ul>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<div id="instance_method_details" class="method_details_list">
|
175
|
+
<h2>Instance Method Details</h2>
|
176
|
+
|
177
|
+
|
178
|
+
<div class="method_details first">
|
179
|
+
<h3 class="signature first" id="repo_clone-instance_method">
|
180
|
+
|
181
|
+
- (<tt>Object</tt>) <strong>repo_clone</strong>(repo, cookbook)
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
</h3><table class="source_code">
|
188
|
+
<tr>
|
189
|
+
<td>
|
190
|
+
<pre class="lines">
|
191
|
+
|
192
|
+
|
193
|
+
78
|
194
|
+
79
|
195
|
+
80
|
196
|
+
81
|
197
|
+
82
|
198
|
+
83
|
199
|
+
84
|
200
|
+
85
|
201
|
+
86
|
202
|
+
87
|
203
|
+
88
|
204
|
+
89
|
205
|
+
90
|
206
|
+
91
|
207
|
+
92
|
208
|
+
93
|
209
|
+
94
|
210
|
+
95
|
211
|
+
96
|
212
|
+
97
|
213
|
+
98
|
214
|
+
99</pre>
|
215
|
+
</td>
|
216
|
+
<td>
|
217
|
+
<pre class="code"><span class="info file"># File 'lib/chef/knife/github_clone.rb', line 78</span>
|
218
|
+
|
219
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_repo_clone'>repo_clone</span><span class='lparen'>(</span><span class='id identifier rubyid_repo'>repo</span><span class='comma'>,</span> <span class='id identifier rubyid_cookbook'>cookbook</span><span class='rparen'>)</span>
|
220
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_repo'>repo</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_repo'>repo</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
221
|
+
<span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Processing [?] </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
222
|
+
<span class='const'>Chef</span><span class='op'>::</span><span class='const'>Log</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot find the repository: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbrace'>}</span><span class='tstring_content'> within github</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
223
|
+
<span class='kw'>return</span> <span class='kw'>nil</span>
|
224
|
+
<span class='kw'>end</span>
|
225
|
+
|
226
|
+
<span class='id identifier rubyid_repo_link'>repo_link</span> <span class='op'>=</span> <span class='id identifier rubyid_get_repo_clone_link'>get_repo_clone_link</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
227
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_repo'>repo</span><span class='lbracket'>[</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_repo'>repo</span><span class='lbracket'>[</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_repo_link'>repo_link</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_repo'>repo</span><span class='lbracket'>[</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_repo_link'>repo_link</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
228
|
+
<span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Processing [?] </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
229
|
+
<span class='const'>Chef</span><span class='op'>::</span><span class='const'>Log</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot find the link for the repository with the name: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
230
|
+
<span class='kw'>return</span> <span class='kw'>nil</span>
|
231
|
+
<span class='kw'>end</span>
|
232
|
+
|
233
|
+
<span class='id identifier rubyid_github_url'>github_url</span> <span class='op'>=</span> <span class='id identifier rubyid_repo'>repo</span><span class='lbracket'>[</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_repo_link'>repo_link</span><span class='rbracket'>]</span>
|
234
|
+
<span class='id identifier rubyid_cookbook_path'>cookbook_path</span> <span class='op'>=</span> <span class='id identifier rubyid_cookbook_path_valid?'>cookbook_path_valid?</span><span class='lparen'>(</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
235
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_cookbook_path'>cookbook_path</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
236
|
+
<span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Processing [C] </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cookbook'>cookbook</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
237
|
+
<span class='const'>Chef</span><span class='op'>::</span><span class='const'>Log</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cloning repository to: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cookbook_path'>cookbook_path</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
238
|
+
<span class='id identifier rubyid_shell_out!'>shell_out!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>git clone </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_github_url'>github_url</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cookbook_path'>cookbook_path</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
239
|
+
<span class='kw'>end</span>
|
240
|
+
<span class='kw'>end</span></pre>
|
241
|
+
</td>
|
242
|
+
</tr>
|
243
|
+
</table>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
<div class="method_details ">
|
247
|
+
<h3 class="signature " id="run-instance_method">
|
248
|
+
|
249
|
+
- (<tt>Object</tt>) <strong>run</strong>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</h3><table class="source_code">
|
256
|
+
<tr>
|
257
|
+
<td>
|
258
|
+
<pre class="lines">
|
259
|
+
|
260
|
+
|
261
|
+
47
|
262
|
+
48
|
263
|
+
49
|
264
|
+
50
|
265
|
+
51
|
266
|
+
52
|
267
|
+
53
|
268
|
+
54
|
269
|
+
55
|
270
|
+
56
|
271
|
+
57
|
272
|
+
58
|
273
|
+
59
|
274
|
+
60
|
275
|
+
61
|
276
|
+
62
|
277
|
+
63
|
278
|
+
64
|
279
|
+
65
|
280
|
+
66
|
281
|
+
67
|
282
|
+
68
|
283
|
+
69
|
284
|
+
70
|
285
|
+
71
|
286
|
+
72
|
287
|
+
73
|
288
|
+
74
|
289
|
+
75
|
290
|
+
76</pre>
|
291
|
+
</td>
|
292
|
+
<td>
|
293
|
+
<pre class="code"><span class="info file"># File 'lib/chef/knife/github_clone.rb', line 47</span>
|
294
|
+
|
295
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
|
296
|
+
|
297
|
+
<span class='comment'>#executing shell commands
|
298
|
+
</span> <span class='id identifier rubyid_extend'>extend</span> <span class='const'>Chef</span><span class='op'>::</span><span class='const'>Mixin</span><span class='op'>::</span><span class='const'>ShellOut</span>
|
299
|
+
|
300
|
+
<span class='comment'># validate base options from base module.
|
301
|
+
</span> <span class='id identifier rubyid_validate_base_options'>validate_base_options</span>
|
302
|
+
|
303
|
+
<span class='comment'># Display information if debug mode is on.
|
304
|
+
</span> <span class='id identifier rubyid_display_debug_info'>display_debug_info</span>
|
305
|
+
|
306
|
+
<span class='comment'># Gather all repo information from github.
|
307
|
+
</span> <span class='id identifier rubyid_all_repos'>all_repos</span> <span class='op'>=</span> <span class='id identifier rubyid_get_all_repos'>get_all_repos</span><span class='lparen'>(</span><span class='ivar'>@github_organizations</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</span><span class='rparen'>)</span>
|
308
|
+
|
309
|
+
<span class='comment'># Get all chef cookbooks and versions (hopefully chef does the error handeling).
|
310
|
+
</span> <span class='id identifier rubyid_cookbooks'>cookbooks</span> <span class='op'>=</span> <span class='id identifier rubyid_rest'>rest</span><span class='period'>.</span><span class='id identifier rubyid_get_rest'>get_rest</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cookbooks?num_version=1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
311
|
+
|
312
|
+
<span class='comment'># Get the cookbook names from the command line
|
313
|
+
</span> <span class='ivar'>@cookbook_name</span> <span class='op'>=</span> <span class='id identifier rubyid_name_args'>name_args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>unless</span> <span class='id identifier rubyid_name_args'>name_args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
314
|
+
<span class='kw'>if</span> <span class='ivar'>@cookbook_name</span>
|
315
|
+
<span class='id identifier rubyid_repo'>repo</span> <span class='op'>=</span> <span class='id identifier rubyid_all_repos'>all_repos</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='ivar'>@cookbook_name</span> <span class='rbrace'>}</span>
|
316
|
+
<span class='id identifier rubyid_repo_clone'>repo_clone</span><span class='lparen'>(</span><span class='id identifier rubyid_repo'>repo</span><span class='comma'>,</span> <span class='ivar'>@cookbook_name</span><span class='rparen'>)</span>
|
317
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:all</span><span class='rbracket'>]</span>
|
318
|
+
<span class='id identifier rubyid_cookbooks'>cookbooks</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
319
|
+
<span class='id identifier rubyid_repo_clone'>repo_clone</span><span class='lparen'>(</span><span class='id identifier rubyid_all_repos'>all_repos</span><span class='comma'>,</span> <span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span>
|
320
|
+
<span class='kw'>end</span>
|
321
|
+
<span class='kw'>else</span>
|
322
|
+
<span class='const'>Chef</span><span class='op'>::</span><span class='const'>Log</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Please specify a repository name</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
323
|
+
<span class='kw'>end</span>
|
324
|
+
<span class='kw'>end</span></pre>
|
325
|
+
</td>
|
326
|
+
</tr>
|
327
|
+
</table>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
</div>
|
331
|
+
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<div id="footer">
|
335
|
+
Generated on Wed Oct 30 20:03:34 2013 by
|
336
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
337
|
+
0.8.7.2 (ruby-1.9.3).
|
338
|
+
</div>
|
339
|
+
|
340
|
+
</body>
|
341
|
+
</html>
|