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.
Files changed (41) hide show
  1. data/.gitignore +1 -0
  2. data/.yardopts +1 -0
  3. data/LICENSE +201 -201
  4. data/Rakefile +5 -0
  5. data/doc/Chef.html +132 -0
  6. data/doc/Chef/Knife.html +138 -0
  7. data/doc/Chef/Knife/GithubBase.html +784 -0
  8. data/doc/Chef/Knife/GithubBaseList.html +316 -0
  9. data/doc/Chef/Knife/GithubClone.html +341 -0
  10. data/doc/Chef/Knife/GithubCompare.html +299 -0
  11. data/doc/Chef/Knife/GithubDeploy.html +1449 -0
  12. data/doc/Chef/Knife/GithubDiff.html +473 -0
  13. data/doc/Chef/Knife/GithubList.html +299 -0
  14. data/doc/KnifeGithubCleanup.html +115 -0
  15. data/doc/KnifeGithubCleanup/GithubCleanup.html +425 -0
  16. data/doc/KnifeGithubSearch.html +115 -0
  17. data/doc/KnifeGithubSearch/GithubSearch.html +325 -0
  18. data/doc/_index.html +206 -0
  19. data/doc/class_list.html +54 -0
  20. data/doc/css/common.css +1 -0
  21. data/doc/css/full_list.css +57 -0
  22. data/doc/css/style.css +338 -0
  23. data/doc/file.README.html +118 -0
  24. data/doc/file_list.html +56 -0
  25. data/doc/frames.html +26 -0
  26. data/doc/index.html +118 -0
  27. data/doc/js/app.js +214 -0
  28. data/doc/js/full_list.js +178 -0
  29. data/doc/js/jquery.js +4 -0
  30. data/doc/method_list.html +197 -0
  31. data/doc/top-level-namespace.html +114 -0
  32. data/lib/chef/knife/github_base.rb +4 -4
  33. data/lib/chef/knife/github_baselist.rb +6 -3
  34. data/lib/chef/knife/github_cleanup.rb +1 -1
  35. data/lib/chef/knife/{github_download.rb → github_clone.rb} +8 -8
  36. data/lib/chef/knife/github_compare.rb +3 -4
  37. data/lib/chef/knife/github_deploy.rb +89 -67
  38. data/lib/chef/knife/github_diff.rb +50 -20
  39. data/lib/chef/knife/github_list.rb +1 -1
  40. data/lib/knife-github/version.rb +1 -1
  41. metadata +32 -3
@@ -0,0 +1,473 @@
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::GithubDiff
8
+
9
+ &mdash; 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> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Chef.html" title="Chef (class)">Chef</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Knife.html" title="Chef::Knife (class)">Knife</a></span></span>
36
+ &raquo;
37
+ <span class="title">GithubDiff</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::GithubDiff
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::GithubDiff</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_diff.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="#do_diff-instance_method" title="#do_diff (instance method)">- (Object) <strong>do_diff</strong>(name, version) </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="#get_cookbook_copy-instance_method" title="#get_cookbook_copy (instance method)">- (Object) <strong>get_cookbook_copy</strong>(name, version) </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
+ <li class="public ">
164
+ <span class="summary_signature">
165
+
166
+ <a href="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong> </a>
167
+
168
+
169
+
170
+ </span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <span class="summary_desc"><div class='inline'></div></span>
181
+
182
+ </li>
183
+
184
+
185
+ </ul>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+ <div id="instance_method_details" class="method_details_list">
197
+ <h2>Instance Method Details</h2>
198
+
199
+
200
+ <div class="method_details first">
201
+ <h3 class="signature first" id="do_diff-instance_method">
202
+
203
+ - (<tt>Object</tt>) <strong>do_diff</strong>(name, version)
204
+
205
+
206
+
207
+
208
+
209
+ </h3><table class="source_code">
210
+ <tr>
211
+ <td>
212
+ <pre class="lines">
213
+
214
+
215
+ 105
216
+ 106
217
+ 107
218
+ 108
219
+ 109
220
+ 110
221
+ 111
222
+ 112
223
+ 113
224
+ 114
225
+ 115
226
+ 116
227
+ 117
228
+ 118
229
+ 119
230
+ 120
231
+ 121
232
+ 122
233
+ 123
234
+ 124
235
+ 125
236
+ 126
237
+ 127
238
+ 128
239
+ 129
240
+ 130</pre>
241
+ </td>
242
+ <td>
243
+ <pre class="code"><span class="info file"># File 'lib/chef/knife/github_diff.rb', line 105</span>
244
+
245
+ <span class='kw'>def</span> <span class='id identifier rubyid_do_diff'>do_diff</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_version'>version</span><span class='rparen'>)</span>
246
+ <span class='comment'># Check to see if there is a tag matching the version
247
+ </span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_chdir'>chdir</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/git/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
248
+ <span class='comment'># Only checkout in github mode
249
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:github</span><span class='rbracket'>]</span>
250
+ <span class='kw'>if</span> <span class='backtick'>`</span><span class='tstring_content'>git tag</span><span class='tstring_end'>`</span></span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_version'>version</span><span class='rparen'>)</span>
251
+ <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'>&quot;</span><span class='tstring_content'>Tag version </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_version'>version</span><span class='rbrace'>}</span><span class='tstring_content'> found, checking that out for diff</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
252
+ <span class='comment'># Tag found so checkout that tag
253
+ </span> <span class='backtick'>`</span><span class='tstring_content'>git checkout -b </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_version'>version</span><span class='rbrace'>}</span><span class='tstring_end'>`</span></span>
254
+ <span class='kw'>if</span> <span class='op'>!</span><span class='gvar'>$?</span><span class='period'>.</span><span class='id identifier rubyid_exitstatus'>exitstatus</span> <span class='op'>==</span> <span class='int'>0</span>
255
+ <span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Failed to checkout branch </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_version'>version</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
256
+ <span class='id identifier rubyid_exit'>exit</span> <span class='int'>1</span>
257
+ <span class='kw'>end</span>
258
+ <span class='kw'>else</span>
259
+ <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'>&quot;</span><span class='tstring_content'>Version </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_version'>version</span><span class='rbrace'>}</span><span class='tstring_content'> of </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> has no tag, using latest for diff</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
260
+ <span class='kw'>end</span>
261
+ <span class='kw'>end</span>
262
+
263
+ <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_remove_entry'>remove_entry</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/git/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>/.git</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
264
+ <span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>git diff --color </span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/git/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/cb/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_version'>version</span><span class='rbrace'>}</span><span class='tstring_content'> 2&gt;&amp;1</span><span class='tstring_end'>`</span></span>
265
+ <span class='kw'>if</span> <span class='id identifier rubyid_output'>output</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
266
+ <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'>&quot;</span><span class='tstring_content'>No differences found</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
267
+ <span class='kw'>else</span>
268
+ <span class='id identifier rubyid_ui'>ui</span><span class='period'>.</span><span class='id identifier rubyid_msg'>msg</span><span class='lparen'>(</span><span class='id identifier rubyid_output'>output</span><span class='rparen'>)</span>
269
+ <span class='kw'>end</span>
270
+ <span class='kw'>end</span></pre>
271
+ </td>
272
+ </tr>
273
+ </table>
274
+ </div>
275
+
276
+ <div class="method_details ">
277
+ <h3 class="signature " id="get_cookbook_copy-instance_method">
278
+
279
+ - (<tt>Object</tt>) <strong>get_cookbook_copy</strong>(name, version)
280
+
281
+
282
+
283
+
284
+
285
+ </h3><table class="source_code">
286
+ <tr>
287
+ <td>
288
+ <pre class="lines">
289
+
290
+
291
+ 132
292
+ 133
293
+ 134
294
+ 135
295
+ 136
296
+ 137
297
+ 138
298
+ 139
299
+ 140
300
+ 141
301
+ 142
302
+ 143
303
+ 144
304
+ 145
305
+ 146
306
+ 147</pre>
307
+ </td>
308
+ <td>
309
+ <pre class="code"><span class="info file"># File 'lib/chef/knife/github_diff.rb', line 132</span>
310
+
311
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_cookbook_copy'>get_cookbook_copy</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_version'>version</span><span class='rparen'>)</span>
312
+ <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mkdir'>mkdir</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/cb</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
313
+ <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cookbook</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>download</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='rbracket'>]</span>
314
+ <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_version'>version</span> <span class='kw'>if</span> <span class='id identifier rubyid_version'>version</span>
315
+ <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_chdir'>chdir</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/cb</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
316
+ <span class='id identifier rubyid_download'>download</span> <span class='op'>=</span> <span class='const'>Chef</span><span class='op'>::</span><span class='const'>Knife</span><span class='op'>::</span><span class='const'>CookbookDownload</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
317
+ <span class='id identifier rubyid_download'>download</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:download_directory</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/cb</span><span class='tstring_end'>&quot;</span></span>
318
+ <span class='id identifier rubyid_download'>download</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
319
+
320
+ <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/cb</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</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_d'>d</span><span class='op'>|</span>
321
+ <span class='kw'>if</span> <span class='id identifier rubyid_d'>d</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>-(.*)</span><span class='regexp_end'>/</span></span>
322
+ <span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='backref'>$1</span>
323
+ <span class='kw'>end</span>
324
+ <span class='kw'>end</span>
325
+ <span class='kw'>return</span> <span class='id identifier rubyid_version'>version</span>
326
+ <span class='kw'>end</span></pre>
327
+ </td>
328
+ </tr>
329
+ </table>
330
+ </div>
331
+
332
+ <div class="method_details ">
333
+ <h3 class="signature " id="run-instance_method">
334
+
335
+ - (<tt>Object</tt>) <strong>run</strong>
336
+
337
+
338
+
339
+
340
+
341
+ </h3><table class="source_code">
342
+ <tr>
343
+ <td>
344
+ <pre class="lines">
345
+
346
+
347
+ 51
348
+ 52
349
+ 53
350
+ 54
351
+ 55
352
+ 56
353
+ 57
354
+ 58
355
+ 59
356
+ 60
357
+ 61
358
+ 62
359
+ 63
360
+ 64
361
+ 65
362
+ 66
363
+ 67
364
+ 68
365
+ 69
366
+ 70
367
+ 71
368
+ 72
369
+ 73
370
+ 74
371
+ 75
372
+ 76
373
+ 77
374
+ 78
375
+ 79
376
+ 80
377
+ 81
378
+ 82
379
+ 83
380
+ 84
381
+ 85
382
+ 86
383
+ 87
384
+ 88
385
+ 89
386
+ 90
387
+ 91
388
+ 92
389
+ 93
390
+ 94
391
+ 95
392
+ 96
393
+ 97
394
+ 98
395
+ 99
396
+ 100
397
+ 101
398
+ 102
399
+ 103</pre>
400
+ </td>
401
+ <td>
402
+ <pre class="code"><span class="info file"># File 'lib/chef/knife/github_diff.rb', line 51</span>
403
+
404
+ <span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
405
+ <span class='comment'># The run method. The entry point into the class
406
+ </span>
407
+ <span class='comment'># validate base options from base module.
408
+ </span> <span class='id identifier rubyid_validate_base_options'>validate_base_options</span>
409
+
410
+ <span class='comment'># Display information if debug mode is on.
411
+ </span> <span class='id identifier rubyid_display_debug_info'>display_debug_info</span>
412
+
413
+ <span class='comment'># Gather all repo information from github.
414
+ </span> <span class='id identifier rubyid_get_all_repos'>get_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>
415
+
416
+ <span class='comment'># Get all chef cookbooks and versions (hopefully chef does the error handeling).
417
+ </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'>&quot;</span><span class='tstring_content'>/cookbooks?num_version=1</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
418
+
419
+ <span class='comment'># Get the cookbook name from the command line
420
+ </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>
421
+ <span class='id identifier rubyid_cookbook_version'>cookbook_version</span> <span class='op'>=</span> <span class='id identifier rubyid_name_args'>name_args</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_name_args'>name_args</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
422
+ <span class='kw'>if</span> <span class='ivar'>@cookbook_name</span>
423
+ <span class='id identifier rubyid_repo'>repo</span> <span class='op'>=</span> <span class='id identifier rubyid_get_all_repos'>get_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'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='ivar'>@cookbook_name</span> <span class='rbrace'>}</span>
424
+ <span class='kw'>else</span>
425
+ <span class='comment'>#repos = all_repos
426
+ </span> <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'>&quot;</span><span class='tstring_content'>Please specify a cookbook name</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
427
+ <span class='id identifier rubyid_exit'>exit</span> <span class='int'>1</span>
428
+ <span class='kw'>end</span>
429
+
430
+ <span class='kw'>if</span> <span class='id identifier rubyid_repo'>repo</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
431
+ <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'>&quot;</span><span class='tstring_content'>Cannot find the repository: </span><span class='embexpr_beg'>#{</span><span class='rbrace'>}</span><span class='tstring_content'> within github</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
432
+ <span class='id identifier rubyid_exit'>exit</span> <span class='int'>1</span>
433
+ <span class='kw'>end</span>
434
+
435
+ <span class='id identifier rubyid_github_link'>github_link</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_repo'>repo</span><span class='lbracket'>[</span><span class='ivar'>@cookbook_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='lparen'>(</span><span class='id identifier rubyid_get_repo_clone_link'>get_repo_clone_link</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='rparen'>)</span>
436
+ <span class='kw'>if</span> <span class='id identifier rubyid_github_link'>github_link</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_github_link'>github_link</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
437
+ <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'>&quot;</span><span class='tstring_content'>Cannot find the link for the repository with the name: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@cookbook_name</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
438
+ <span class='id identifier rubyid_exit'>exit</span> <span class='int'>1</span>
439
+ <span class='kw'>end</span>
440
+
441
+ <span class='kw'>if</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:github</span><span class='rbracket'>]</span>
442
+ <span class='id identifier rubyid_get_clone'>get_clone</span><span class='lparen'>(</span><span class='id identifier rubyid_github_link'>github_link</span><span class='comma'>,</span> <span class='ivar'>@cookbook_name</span><span class='rparen'>)</span>
443
+ <span class='kw'>else</span> <span class='comment'># Copy downloaded version to #{@github_tmp}/git
444
+ </span> <span class='id identifier rubyid_cpath'>cpath</span> <span class='op'>=</span> <span class='id identifier rubyid_cookbook_path_valid?'>cookbook_path_valid?</span><span class='lparen'>(</span><span class='ivar'>@cookbook_name</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
445
+ <span class='id identifier rubyid_tpath'>tpath</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@github_tmp</span><span class='rbrace'>}</span><span class='tstring_content'>/git</span><span class='tstring_end'>&quot;</span></span>
446
+ <span class='kw'>if</span> <span class='op'>!</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_tpath'>tpath</span><span class='rparen'>)</span>
447
+ <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_makedirs'>makedirs</span><span class='lparen'>(</span><span class='id identifier rubyid_tpath'>tpath</span><span class='rparen'>)</span>
448
+ <span class='kw'>end</span>
449
+ <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_cp_r'>cp_r</span> <span class='id identifier rubyid_cpath'>cpath</span><span class='comma'>,</span> <span class='id identifier rubyid_tpath'>tpath</span>
450
+ <span class='kw'>end</span>
451
+
452
+ <span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='id identifier rubyid_get_cookbook_copy'>get_cookbook_copy</span><span class='lparen'>(</span><span class='ivar'>@cookbook_name</span><span class='comma'>,</span> <span class='id identifier rubyid_cookbook_version'>cookbook_version</span><span class='rparen'>)</span>
453
+
454
+ <span class='id identifier rubyid_do_diff'>do_diff</span><span class='lparen'>(</span><span class='ivar'>@cookbook_name</span><span class='comma'>,</span> <span class='id identifier rubyid_version'>version</span><span class='rparen'>)</span>
455
+ <span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_remove_entry'>remove_entry</span><span class='lparen'>(</span><span class='ivar'>@github_tmp</span><span class='rparen'>)</span>
456
+ <span class='kw'>end</span></pre>
457
+ </td>
458
+ </tr>
459
+ </table>
460
+ </div>
461
+
462
+ </div>
463
+
464
+ </div>
465
+
466
+ <div id="footer">
467
+ Generated on Wed Oct 30 20:03:34 2013 by
468
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
469
+ 0.8.7.2 (ruby-1.9.3).
470
+ </div>
471
+
472
+ </body>
473
+ </html>