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,299 @@
|
|
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::GithubList
|
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">GithubList</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::GithubList
|
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::GithubList</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_list.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="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong> </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
|
+
</ul>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<div id="instance_method_details" class="method_details_list">
|
153
|
+
<h2>Instance Method Details</h2>
|
154
|
+
|
155
|
+
|
156
|
+
<div class="method_details first">
|
157
|
+
<h3 class="signature first" id="run-instance_method">
|
158
|
+
|
159
|
+
- (<tt>Object</tt>) <strong>run</strong>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
</h3><table class="source_code">
|
166
|
+
<tr>
|
167
|
+
<td>
|
168
|
+
<pre class="lines">
|
169
|
+
|
170
|
+
|
171
|
+
42
|
172
|
+
43
|
173
|
+
44
|
174
|
+
45
|
175
|
+
46
|
176
|
+
47
|
177
|
+
48
|
178
|
+
49
|
179
|
+
50
|
180
|
+
51
|
181
|
+
52
|
182
|
+
53
|
183
|
+
54
|
184
|
+
55
|
185
|
+
56
|
186
|
+
57
|
187
|
+
58
|
188
|
+
59
|
189
|
+
60
|
190
|
+
61
|
191
|
+
62
|
192
|
+
63
|
193
|
+
64
|
194
|
+
65
|
195
|
+
66
|
196
|
+
67
|
197
|
+
68
|
198
|
+
69
|
199
|
+
70
|
200
|
+
71
|
201
|
+
72
|
202
|
+
73
|
203
|
+
74
|
204
|
+
75
|
205
|
+
76
|
206
|
+
77
|
207
|
+
78
|
208
|
+
79
|
209
|
+
80
|
210
|
+
81
|
211
|
+
82
|
212
|
+
83
|
213
|
+
84
|
214
|
+
85
|
215
|
+
86
|
216
|
+
87
|
217
|
+
88
|
218
|
+
89
|
219
|
+
90
|
220
|
+
91
|
221
|
+
92
|
222
|
+
93
|
223
|
+
94
|
224
|
+
95</pre>
|
225
|
+
</td>
|
226
|
+
<td>
|
227
|
+
<pre class="code"><span class="info file"># File 'lib/chef/knife/github_list.rb', line 42</span>
|
228
|
+
|
229
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
|
230
|
+
|
231
|
+
<span class='comment'># validate base options from base module.
|
232
|
+
</span> <span class='id identifier rubyid_validate_base_options'>validate_base_options</span>
|
233
|
+
|
234
|
+
<span class='comment'># Display information if debug mode is on.
|
235
|
+
</span> <span class='id identifier rubyid_display_debug_info'>display_debug_info</span>
|
236
|
+
|
237
|
+
<span class='comment'># Gather all repo information from github.
|
238
|
+
</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>
|
239
|
+
|
240
|
+
<span class='comment'># Get all chef cookbooks and versions (hopefully chef does the error handeling).
|
241
|
+
</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>
|
242
|
+
|
243
|
+
<span class='comment'>#Get the github link
|
244
|
+
</span> <span class='id identifier rubyid_git_link'>git_link</span> <span class='op'>=</span> <span class='id identifier rubyid_get_repo_clone_link'>get_repo_clone_link</span>
|
245
|
+
|
246
|
+
<span class='comment'># Filter all repo information based on the tags that we can find
|
247
|
+
</span> <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> <span class='op'>||</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:fieldlist</span><span class='rbracket'>]</span>
|
248
|
+
<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>
|
249
|
+
<span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='tstring_end'>"</span></span> <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><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <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_empty?'>empty?</span>
|
250
|
+
<span class='kw'>else</span>
|
251
|
+
<span class='id identifier rubyid_all_repos'>all_repos</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
252
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:all</span><span class='rbracket'>]</span>
|
253
|
+
<span class='id identifier rubyid_get_all_repos'>get_all_repos</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_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
254
|
+
<span class='id identifier rubyid_cookbooks'>cookbooks</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_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_cookbooks'>cookbooks</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>versions</span><span class='tstring_end'>'</span></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_version'>version</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='id identifier rubyid_cookbooks'>cookbooks</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>versions</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>version</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
255
|
+
<span class='id identifier rubyid_all_repos'>all_repos</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>latest_cb_tag</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_version'>version</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git_url</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_v'>v</span><span class='lbracket'>[</span><span class='id identifier rubyid_git_link'>git_link</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>latest_gh_tag</span><span class='tstring_end'>'</span></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'>latest_tag</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
256
|
+
<span class='rbrace'>}</span>
|
257
|
+
<span class='kw'>else</span>
|
258
|
+
<span class='id identifier rubyid_cookbooks'>cookbooks</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_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
259
|
+
<span class='id identifier rubyid_get_all_repos'>get_all_repos</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_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_get_all_repos'>get_all_repos</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_git_link'>git_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_gh_url'>gh_url</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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ERROR: Cannot find cookbook!</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:red</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_gh_url'>gh_url</span> <span class='op'>=</span> <span class='id identifier rubyid_get_all_repos'>get_all_repos</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_git_link'>git_link</span><span class='rbracket'>]</span>
|
260
|
+
<span class='id identifier rubyid_get_all_repos'>get_all_repos</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_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_get_all_repos'>get_all_repos</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>latest_tag</span><span class='tstring_end'>'</span></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_gh_tag'>gh_tag</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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ERROR: No tags!</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:red</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_gh_tag'>gh_tag</span> <span class='op'>=</span> <span class='id identifier rubyid_get_all_repos'>get_all_repos</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>latest_tag</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
261
|
+
<span class='id identifier rubyid_all_repos'>all_repos</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>latest_cb_tag</span><span class='tstring_end'>'</span></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'>versions</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>version</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git_url</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_gh_url'>gh_url</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>latest_gh_tag</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_gh_tag'>gh_tag</span> <span class='rbrace'>}</span>
|
262
|
+
<span class='rbrace'>}</span>
|
263
|
+
<span class='kw'>end</span>
|
264
|
+
<span class='kw'>end</span>
|
265
|
+
|
266
|
+
<span class='comment'># Filter only on the cookbook name if its given on the command line
|
267
|
+
</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>
|
268
|
+
<span class='kw'>if</span> <span class='ivar'>@cookbook_name</span>
|
269
|
+
<span class='id identifier rubyid_repos'>repos</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>
|
270
|
+
<span class='kw'>else</span>
|
271
|
+
<span class='id identifier rubyid_repos'>repos</span> <span class='op'>=</span> <span class='id identifier rubyid_all_repos'>all_repos</span>
|
272
|
+
<span class='kw'>end</span>
|
273
|
+
|
274
|
+
<span class='id identifier rubyid_columns'>columns</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name,Name</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git_url,Link</span><span class='tstring_end'>'</span></span> <span class='rbracket'>]</span>
|
275
|
+
|
276
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_repos'>repos</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_repos'>repos</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
277
|
+
<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'>No repositories found.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
278
|
+
<span class='kw'>else</span>
|
279
|
+
<span class='id identifier rubyid_display_info'>display_info</span><span class='lparen'>(</span><span class='id identifier rubyid_repos'>repos</span><span class='comma'>,</span> <span class='id identifier rubyid_columns'>columns</span> <span class='rparen'>)</span>
|
280
|
+
<span class='kw'>end</span>
|
281
|
+
|
282
|
+
<span class='kw'>end</span></pre>
|
283
|
+
</td>
|
284
|
+
</tr>
|
285
|
+
</table>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
</div>
|
289
|
+
|
290
|
+
</div>
|
291
|
+
|
292
|
+
<div id="footer">
|
293
|
+
Generated on Wed Oct 30 20:03:34 2013 by
|
294
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
295
|
+
0.8.7.2 (ruby-1.9.3).
|
296
|
+
</div>
|
297
|
+
|
298
|
+
</body>
|
299
|
+
</html>
|
@@ -0,0 +1,115 @@
|
|
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: KnifeGithubCleanup
|
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 (K)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">KnifeGithubCleanup</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: KnifeGithubCleanup
|
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_cleanup.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
<h2>Defined Under Namespace</h2>
|
88
|
+
<p class="children">
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="KnifeGithubCleanup/GithubCleanup.html" title="KnifeGithubCleanup::GithubCleanup (class)">GithubCleanup</a></span>
|
94
|
+
|
95
|
+
|
96
|
+
</p>
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div id="footer">
|
109
|
+
Generated on Wed Oct 30 20:03:34 2013 by
|
110
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
111
|
+
0.8.7.2 (ruby-1.9.3).
|
112
|
+
</div>
|
113
|
+
|
114
|
+
</body>
|
115
|
+
</html>
|
@@ -0,0 +1,425 @@
|
|
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: KnifeGithubCleanup::GithubCleanup
|
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="../KnifeGithubCleanup.html" title="KnifeGithubCleanup (module)">KnifeGithubCleanup</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">GithubCleanup</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: KnifeGithubCleanup::GithubCleanup
|
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="../Chef/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="../Chef/Knife.html" title="Chef::Knife (class)">Chef::Knife</a></span></li>
|
82
|
+
|
83
|
+
<li class="next">KnifeGithubCleanup::GithubCleanup</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_cleanup.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_cleanup-instance_method" title="#repo_cleanup (instance method)">- (Object) <strong>repo_cleanup</strong>(repo) </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="#repo_status_clean%3F-instance_method" title="#repo_status_clean? (instance method)">- (Boolean) <strong>repo_status_clean?</strong>(repo, cookbook) </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="repo_cleanup-instance_method">
|
202
|
+
|
203
|
+
- (<tt>Object</tt>) <strong>repo_cleanup</strong>(repo)
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
</h3><table class="source_code">
|
210
|
+
<tr>
|
211
|
+
<td>
|
212
|
+
<pre class="lines">
|
213
|
+
|
214
|
+
|
215
|
+
88
|
216
|
+
89
|
217
|
+
90
|
218
|
+
91
|
219
|
+
92
|
220
|
+
93
|
221
|
+
94
|
222
|
+
95
|
223
|
+
96
|
224
|
+
97
|
225
|
+
98
|
226
|
+
99
|
227
|
+
100</pre>
|
228
|
+
</td>
|
229
|
+
<td>
|
230
|
+
<pre class="code"><span class="info file"># File 'lib/chef/knife/github_cleanup.rb', line 88</span>
|
231
|
+
|
232
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_repo_cleanup'>repo_cleanup</span><span class='lparen'>(</span><span class='id identifier rubyid_repo'>repo</span><span class='rparen'>)</span>
|
233
|
+
<span class='id identifier rubyid_cookbook_path'>cookbook_path</span> <span class='op'>=</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:cookbook_path</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>Chef</span><span class='op'>::</span><span class='const'>Config</span><span class='lbracket'>[</span><span class='symbol'>:cookbook_path</span><span class='rbracket'>]</span>
|
234
|
+
<span class='id identifier rubyid_cookbook'>cookbook</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_cookbook_path'>cookbook_path</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='comma'>,</span><span class='id identifier rubyid_repo'>repo</span><span class='rparen'>)</span>
|
235
|
+
<span class='kw'>if</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_cookbook'>cookbook</span><span class='rparen'>)</span>
|
236
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_repo_status_clean?'>repo_status_clean?</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>
|
237
|
+
<span class='comment'># delete the repo
|
238
|
+
</span> <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 [D] </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_repo'>repo</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
239
|
+
<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='id identifier rubyid_cookbook'>cookbook</span><span class='rparen'>)</span>
|
240
|
+
<span class='kw'>end</span>
|
241
|
+
<span class='kw'>else</span>
|
242
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cannot find repo path for: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_repo'>repo</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='symbol'>:all</span><span class='rbracket'>]</span>
|
243
|
+
<span class='kw'>end</span>
|
244
|
+
<span class='kw'>end</span></pre>
|
245
|
+
</td>
|
246
|
+
</tr>
|
247
|
+
</table>
|
248
|
+
</div>
|
249
|
+
|
250
|
+
<div class="method_details ">
|
251
|
+
<h3 class="signature " id="repo_status_clean?-instance_method">
|
252
|
+
|
253
|
+
- (<tt>Boolean</tt>) <strong>repo_status_clean?</strong>(repo, cookbook)
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
</h3><div class="docstring">
|
260
|
+
<div class="discussion">
|
261
|
+
|
262
|
+
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
<div class="tags">
|
266
|
+
|
267
|
+
<p class="tag_title">Returns:</p>
|
268
|
+
<ul class="return">
|
269
|
+
|
270
|
+
<li>
|
271
|
+
|
272
|
+
|
273
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
</li>
|
278
|
+
|
279
|
+
</ul>
|
280
|
+
|
281
|
+
</div><table class="source_code">
|
282
|
+
<tr>
|
283
|
+
<td>
|
284
|
+
<pre class="lines">
|
285
|
+
|
286
|
+
|
287
|
+
102
|
288
|
+
103
|
289
|
+
104
|
290
|
+
105
|
291
|
+
106
|
292
|
+
107
|
293
|
+
108
|
294
|
+
109
|
295
|
+
110
|
296
|
+
111
|
297
|
+
112
|
298
|
+
113
|
299
|
+
114
|
300
|
+
115
|
301
|
+
116
|
302
|
+
117
|
303
|
+
118</pre>
|
304
|
+
</td>
|
305
|
+
<td>
|
306
|
+
<pre class="code"><span class="info file"># File 'lib/chef/knife/github_cleanup.rb', line 102</span>
|
307
|
+
|
308
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_repo_status_clean?'>repo_status_clean?</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>
|
309
|
+
<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 fetch</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:cwd</span> <span class='op'>=></span> <span class='id identifier rubyid_cookbook'>cookbook</span><span class='rparen'>)</span>
|
310
|
+
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <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 status</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:cwd</span> <span class='op'>=></span> <span class='id identifier rubyid_cookbook'>cookbook</span><span class='rparen'>)</span>
|
311
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_status'>status</span><span class='period'>.</span><span class='id identifier rubyid_stdout'>stdout</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'># On branch master\nnothing to commit (working directory clean)\n</span><span class='tstring_end'>"</span></span>
|
312
|
+
<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_repo'>repo</span><span class='rbrace'>}</span><span class='tstring_content'> (Action needed!)</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
313
|
+
<span class='id identifier rubyid_status'>status</span><span class='period'>.</span><span class='id identifier rubyid_stdout'>stdout</span><span class='period'>.</span><span class='id identifier rubyid_lines'>lines</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_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_sub'>sub</span><span class='lparen'>(</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^</span><span class='regexp_end'>/</span></span><span class='comma'>,</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='rbrace'>}</span>
|
314
|
+
<span class='kw'>return</span> <span class='kw'>false</span>
|
315
|
+
<span class='kw'>end</span>
|
316
|
+
<span class='id identifier rubyid_log'>log</span> <span class='op'>=</span> <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 log --branches --not --remotes --simplify-by-decoration --decorate --oneline</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:cwd</span> <span class='op'>=></span> <span class='id identifier rubyid_cookbook'>cookbook</span><span class='rparen'>)</span>
|
317
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_log'>log</span><span class='period'>.</span><span class='id identifier rubyid_stdout'>stdout</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
318
|
+
<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 [B] </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_repo'>repo</span><span class='rbrace'>}</span><span class='tstring_content'> (Action needed!)</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
319
|
+
<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'> Please check your branches, one of them has unsaved changes</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
320
|
+
<span class='id identifier rubyid_log'>log</span><span class='period'>.</span><span class='id identifier rubyid_stdout'>stdout</span><span class='period'>.</span><span class='id identifier rubyid_lines'>lines</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_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_sub'>sub</span><span class='lparen'>(</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^</span><span class='regexp_end'>/</span></span><span class='comma'>,</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='rbrace'>}</span>
|
321
|
+
<span class='kw'>return</span> <span class='kw'>false</span>
|
322
|
+
<span class='kw'>end</span>
|
323
|
+
<span class='kw'>return</span> <span class='kw'>true</span>
|
324
|
+
<span class='kw'>end</span></pre>
|
325
|
+
</td>
|
326
|
+
</tr>
|
327
|
+
</table>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
<div class="method_details ">
|
331
|
+
<h3 class="signature " id="run-instance_method">
|
332
|
+
|
333
|
+
- (<tt>Object</tt>) <strong>run</strong>
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
</h3><table class="source_code">
|
340
|
+
<tr>
|
341
|
+
<td>
|
342
|
+
<pre class="lines">
|
343
|
+
|
344
|
+
|
345
|
+
57
|
346
|
+
58
|
347
|
+
59
|
348
|
+
60
|
349
|
+
61
|
350
|
+
62
|
351
|
+
63
|
352
|
+
64
|
353
|
+
65
|
354
|
+
66
|
355
|
+
67
|
356
|
+
68
|
357
|
+
69
|
358
|
+
70
|
359
|
+
71
|
360
|
+
72
|
361
|
+
73
|
362
|
+
74
|
363
|
+
75
|
364
|
+
76
|
365
|
+
77
|
366
|
+
78
|
367
|
+
79
|
368
|
+
80
|
369
|
+
81
|
370
|
+
82
|
371
|
+
83
|
372
|
+
84
|
373
|
+
85
|
374
|
+
86</pre>
|
375
|
+
</td>
|
376
|
+
<td>
|
377
|
+
<pre class="code"><span class="info file"># File 'lib/chef/knife/github_cleanup.rb', line 57</span>
|
378
|
+
|
379
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
|
380
|
+
|
381
|
+
<span class='comment'>#executing shell commands
|
382
|
+
</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>
|
383
|
+
|
384
|
+
<span class='comment'># validate base options from base module.
|
385
|
+
</span> <span class='id identifier rubyid_validate_base_options'>validate_base_options</span>
|
386
|
+
|
387
|
+
<span class='comment'># Display information if debug mode is on.
|
388
|
+
</span> <span class='id identifier rubyid_display_debug_info'>display_debug_info</span>
|
389
|
+
|
390
|
+
<span class='comment'># Gather all repo information from github.
|
391
|
+
</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>
|
392
|
+
|
393
|
+
<span class='comment'># Get all chef cookbooks and versions (hopefully chef does the error handeling).
|
394
|
+
</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>
|
395
|
+
|
396
|
+
<span class='comment'># Get the cookbook names from the command line
|
397
|
+
</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>
|
398
|
+
<span class='kw'>if</span> <span class='ivar'>@cookbook_name</span>
|
399
|
+
<span class='comment'># repo = all_repos.select { |k,v| v["name"] == @cookbook_name }
|
400
|
+
</span> <span class='id identifier rubyid_repo_cleanup'>repo_cleanup</span><span class='lparen'>(</span><span class='ivar'>@cookbook_name</span><span class='rparen'>)</span>
|
401
|
+
<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>
|
402
|
+
<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>
|
403
|
+
<span class='id identifier rubyid_repo_cleanup'>repo_cleanup</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span>
|
404
|
+
<span class='kw'>end</span>
|
405
|
+
<span class='kw'>else</span>
|
406
|
+
<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 repo name</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
407
|
+
<span class='kw'>end</span>
|
408
|
+
<span class='kw'>end</span></pre>
|
409
|
+
</td>
|
410
|
+
</tr>
|
411
|
+
</table>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
</div>
|
415
|
+
|
416
|
+
</div>
|
417
|
+
|
418
|
+
<div id="footer">
|
419
|
+
Generated on Wed Oct 30 20:03:34 2013 by
|
420
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
421
|
+
0.8.7.2 (ruby-1.9.3).
|
422
|
+
</div>
|
423
|
+
|
424
|
+
</body>
|
425
|
+
</html>
|