swift-manager 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.gitignore +2 -0
  2. data/Gemfile +19 -0
  3. data/LICENSE +201 -0
  4. data/README.md +56 -0
  5. data/README.rdoc +8 -0
  6. data/Rakefile +38 -0
  7. data/bin/swift-manager +337 -0
  8. data/docs/examples.txt +407 -0
  9. data/html/CloudShell.html +308 -0
  10. data/html/CloudShell/Context.html +403 -0
  11. data/html/Configurator.html +270 -0
  12. data/html/Formatter.html +272 -0
  13. data/html/Object.html +165 -0
  14. data/html/Parser.html +291 -0
  15. data/html/README_rdoc.html +102 -0
  16. data/html/SwiftClient.html +656 -0
  17. data/html/SwiftManager.html +181 -0
  18. data/html/bin/swift-manager.html +103 -0
  19. data/html/created.rid +9 -0
  20. data/html/images/brick.png +0 -0
  21. data/html/images/brick_link.png +0 -0
  22. data/html/images/bug.png +0 -0
  23. data/html/images/bullet_black.png +0 -0
  24. data/html/images/bullet_toggle_minus.png +0 -0
  25. data/html/images/bullet_toggle_plus.png +0 -0
  26. data/html/images/date.png +0 -0
  27. data/html/images/find.png +0 -0
  28. data/html/images/loadingAnimation.gif +0 -0
  29. data/html/images/macFFBgHack.png +0 -0
  30. data/html/images/package.png +0 -0
  31. data/html/images/page_green.png +0 -0
  32. data/html/images/page_white_text.png +0 -0
  33. data/html/images/page_white_width.png +0 -0
  34. data/html/images/plugin.png +0 -0
  35. data/html/images/ruby.png +0 -0
  36. data/html/images/tag_green.png +0 -0
  37. data/html/images/wrench.png +0 -0
  38. data/html/images/wrench_orange.png +0 -0
  39. data/html/images/zoom.png +0 -0
  40. data/html/index.html +119 -0
  41. data/html/js/darkfish.js +116 -0
  42. data/html/js/jquery.js +32 -0
  43. data/html/js/quicksearch.js +114 -0
  44. data/html/js/thickbox-compressed.js +10 -0
  45. data/html/lib/cloud_shell_rb.html +75 -0
  46. data/html/lib/configurator_rb.html +75 -0
  47. data/html/lib/formatter_rb.html +75 -0
  48. data/html/lib/parser_rb.html +75 -0
  49. data/html/lib/swift-manager_version_rb.html +75 -0
  50. data/html/lib/swift_client_rb.html +75 -0
  51. data/html/rdoc.css +763 -0
  52. data/lib/cloud_shell.rb +127 -0
  53. data/lib/configurator.rb +69 -0
  54. data/lib/formatter.rb +42 -0
  55. data/lib/parser.rb +60 -0
  56. data/lib/swift-manager_version.rb +21 -0
  57. data/lib/swift_client.rb +172 -0
  58. data/swift-manager.gemspec +48 -0
  59. data/swift-manager.rdoc +2 -0
  60. data/test/tc_nothing.rb +14 -0
  61. metadata +174 -0
@@ -0,0 +1,403 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: CloudShell::Context</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="class">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="../index.html">Home</a>
25
+ <a href="../index.html#classes">Classes</a>
26
+ <a href="../index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="../lib/cloud_shell_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/cloud_shell.rb">lib/cloud_shell.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link"><a href="../Object.html">Object</a></p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-c-new">::new</a></li>
69
+
70
+ <li><a href="#method-i-cat">#cat</a></li>
71
+
72
+ <li><a href="#method-i-cd">#cd</a></li>
73
+
74
+ <li><a href="#method-i-completions">#completions</a></li>
75
+
76
+ <li><a href="#method-i-to_s">#to_s</a></li>
77
+
78
+ </ul>
79
+ </div>
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="project-metadata">
86
+
87
+
88
+ <div id="fileindex-section" class="section project-section">
89
+ <h3 class="section-header">Files</h3>
90
+ <ul>
91
+
92
+ <li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
93
+
94
+ </ul>
95
+ </div>
96
+
97
+
98
+ <div id="classindex-section" class="section project-section">
99
+ <h3 class="section-header">Class/Module Index
100
+ <span class="search-toggle"><img src="../images/find.png"
101
+ height="16" width="16" alt="[+]"
102
+ title="show/hide quicksearch" /></span></h3>
103
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
104
+ <fieldset>
105
+ <legend>Quicksearch</legend>
106
+ <input type="text" name="quicksearch" value=""
107
+ class="quicksearch-field" />
108
+ </fieldset>
109
+ </form>
110
+
111
+ <ul class="link-list">
112
+
113
+ <li><a href="../CloudShell.html">CloudShell</a></li>
114
+
115
+ <li><a href="../CloudShell/Context.html">CloudShell::Context</a></li>
116
+
117
+ <li><a href="../Configurator.html">Configurator</a></li>
118
+
119
+ <li><a href="../Formatter.html">Formatter</a></li>
120
+
121
+ <li><a href="../Object.html">Object</a></li>
122
+
123
+ <li><a href="../Parser.html">Parser</a></li>
124
+
125
+ <li><a href="../SwiftClient.html">SwiftClient</a></li>
126
+
127
+ <li><a href="../SwiftManager.html">SwiftManager</a></li>
128
+
129
+ </ul>
130
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
131
+ </div>
132
+
133
+
134
+ </div>
135
+ </div>
136
+
137
+ <div id="documentation">
138
+ <h1 class="class">CloudShell::Context</h1>
139
+
140
+ <div id="description" class="description">
141
+
142
+ </div><!-- description -->
143
+
144
+
145
+
146
+
147
+ <div id="5Buntitled-5D" class="documentation-section">
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+ <!-- Attributes -->
156
+ <div id="attribute-method-details" class="method-section section">
157
+ <h3 class="section-header">Attributes</h3>
158
+
159
+
160
+ <div id="here-attribute-method" class="method-detail">
161
+ <a name="here"></a>
162
+
163
+ <div class="method-heading attribute-method-heading">
164
+ <span class="method-name">here</span><span
165
+ class="attribute-access-type">[R]</span>
166
+ </div>
167
+
168
+ <div class="method-description">
169
+
170
+
171
+
172
+ </div>
173
+ </div>
174
+
175
+ <div id="parent_context-attribute-method" class="method-detail">
176
+ <a name="parent_context"></a>
177
+
178
+ <div class="method-heading attribute-method-heading">
179
+ <span class="method-name">parent_context</span><span
180
+ class="attribute-access-type">[R]</span>
181
+ </div>
182
+
183
+ <div class="method-description">
184
+
185
+
186
+
187
+ </div>
188
+ </div>
189
+
190
+ </div><!-- attribute-method-details -->
191
+
192
+
193
+ <!-- Methods -->
194
+
195
+ <div id="public-class-method-details" class="method-section section">
196
+ <h3 class="section-header">Public Class Methods</h3>
197
+
198
+
199
+ <div id="new-method" class="method-detail ">
200
+ <a name="method-c-new"></a>
201
+
202
+
203
+ <div class="method-heading">
204
+ <span class="method-name">new</span><span
205
+ class="method-args">(here,parent_context)</span>
206
+ <span class="method-click-advice">click to toggle source</span>
207
+ </div>
208
+
209
+
210
+ <div class="method-description">
211
+
212
+
213
+
214
+
215
+
216
+ <div class="method-source-code" id="new-source">
217
+ <pre>
218
+ <span class="ruby-comment"># File lib/cloud_shell.rb, line 74</span>
219
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">here</span>,<span class="ruby-identifier">parent_context</span>)
220
+ <span class="ruby-ivar">@here</span> = <span class="ruby-identifier">here</span>
221
+ <span class="ruby-ivar">@parent_context</span> = <span class="ruby-identifier">parent_context</span>
222
+ <span class="ruby-keyword">end</span></pre>
223
+ </div><!-- new-source -->
224
+
225
+ </div>
226
+
227
+
228
+
229
+
230
+ </div><!-- new-method -->
231
+
232
+
233
+ </div><!-- public-class-method-details -->
234
+
235
+ <div id="public-instance-method-details" class="method-section section">
236
+ <h3 class="section-header">Public Instance Methods</h3>
237
+
238
+
239
+ <div id="cat-method" class="method-detail ">
240
+ <a name="method-i-cat"></a>
241
+
242
+
243
+ <div class="method-heading">
244
+ <span class="method-name">cat</span><span
245
+ class="method-args">(path)</span>
246
+ <span class="method-click-advice">click to toggle source</span>
247
+ </div>
248
+
249
+
250
+ <div class="method-description">
251
+
252
+
253
+
254
+
255
+
256
+ <div class="method-source-code" id="cat-source">
257
+ <pre>
258
+ <span class="ruby-comment"># File lib/cloud_shell.rb, line 83</span>
259
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">cat</span>(<span class="ruby-identifier">path</span>)
260
+ <span class="ruby-identifier">item_at</span>(<span class="ruby-identifier">path</span>)
261
+ <span class="ruby-keyword">end</span></pre>
262
+ </div><!-- cat-source -->
263
+
264
+ </div>
265
+
266
+
267
+
268
+
269
+ </div><!-- cat-method -->
270
+
271
+
272
+ <div id="cd-method" class="method-detail ">
273
+ <a name="method-i-cd"></a>
274
+
275
+
276
+ <div class="method-heading">
277
+ <span class="method-name">cd</span><span
278
+ class="method-args">(path)</span>
279
+ <span class="method-click-advice">click to toggle source</span>
280
+ </div>
281
+
282
+
283
+ <div class="method-description">
284
+
285
+
286
+
287
+
288
+
289
+ <div class="method-source-code" id="cd-source">
290
+ <pre>
291
+ <span class="ruby-comment"># File lib/cloud_shell.rb, line 87</span>
292
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">cd</span>(<span class="ruby-identifier">path</span>)
293
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-string">'..'</span>
294
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent_context</span>
295
+ <span class="ruby-keyword">else</span>
296
+ <span class="ruby-identifier">item</span> = <span class="ruby-identifier">item_at</span>(<span class="ruby-identifier">path</span>)
297
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">nil?</span>
298
+ <span class="ruby-keyword">nil</span>
299
+ <span class="ruby-keyword">else</span>
300
+ <span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">item</span>,<span class="ruby-keyword">self</span>)
301
+ <span class="ruby-keyword">end</span>
302
+ <span class="ruby-keyword">end</span>
303
+ <span class="ruby-keyword">end</span></pre>
304
+ </div><!-- cd-source -->
305
+
306
+ </div>
307
+
308
+
309
+
310
+
311
+ </div><!-- cd-method -->
312
+
313
+
314
+ <div id="completions-method" class="method-detail ">
315
+ <a name="method-i-completions"></a>
316
+
317
+
318
+ <div class="method-heading">
319
+ <span class="method-name">completions</span><span
320
+ class="method-args">(input)</span>
321
+ <span class="method-click-advice">click to toggle source</span>
322
+ </div>
323
+
324
+
325
+ <div class="method-description">
326
+
327
+
328
+
329
+
330
+
331
+ <div class="method-source-code" id="completions-source">
332
+ <pre>
333
+ <span class="ruby-comment"># File lib/cloud_shell.rb, line 79</span>
334
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">completions</span>(<span class="ruby-identifier">input</span>)
335
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\s+/</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-node">/^#{input}/</span>)
336
+ <span class="ruby-keyword">end</span></pre>
337
+ </div><!-- completions-source -->
338
+
339
+ </div>
340
+
341
+
342
+
343
+
344
+ </div><!-- completions-method -->
345
+
346
+
347
+ <div id="to_s-method" class="method-detail ">
348
+ <a name="method-i-to_s"></a>
349
+
350
+
351
+ <div class="method-heading">
352
+ <span class="method-name">to_s</span><span
353
+ class="method-args">()</span>
354
+ <span class="method-click-advice">click to toggle source</span>
355
+ </div>
356
+
357
+
358
+ <div class="method-description">
359
+
360
+
361
+
362
+
363
+
364
+ <div class="method-source-code" id="to_s-source">
365
+ <pre>
366
+ <span class="ruby-comment"># File lib/cloud_shell.rb, line 100</span>
367
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
368
+ <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
369
+ <span class="ruby-identifier">indices</span> = []
370
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">each_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">indices</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">i</span> }
371
+ <span class="ruby-identifier">indices</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
372
+ <span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Hash</span>
373
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
374
+ <span class="ruby-keyword">else</span>
375
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">to_s</span>
376
+ <span class="ruby-keyword">end</span>
377
+ <span class="ruby-keyword">end</span></pre>
378
+ </div><!-- to_s-source -->
379
+
380
+ </div>
381
+
382
+
383
+
384
+
385
+ </div><!-- to_s-method -->
386
+
387
+
388
+ </div><!-- public-instance-method-details -->
389
+
390
+ </div><!-- 5Buntitled-5D -->
391
+
392
+
393
+ </div><!-- documentation -->
394
+
395
+ <div id="validator-badges">
396
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
397
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
398
+ Rdoc Generator</a> 2</small>.</p>
399
+ </div>
400
+
401
+ </body>
402
+ </html>
403
+
@@ -0,0 +1,270 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: Configurator</title>
9
+
10
+ <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="class">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="./index.html">Home</a>
25
+ <a href="./index.html#classes">Classes</a>
26
+ <a href="./index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="./lib/configurator_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/configurator.rb">lib/configurator.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link"><a href="Object.html">Object</a></p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-i-create_auth_config">#create_auth_config</a></li>
69
+
70
+ </ul>
71
+ </div>
72
+
73
+
74
+
75
+ </div>
76
+
77
+ <div id="project-metadata">
78
+
79
+
80
+ <div id="fileindex-section" class="section project-section">
81
+ <h3 class="section-header">Files</h3>
82
+ <ul>
83
+
84
+ <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
85
+
86
+ </ul>
87
+ </div>
88
+
89
+
90
+ <div id="classindex-section" class="section project-section">
91
+ <h3 class="section-header">Class/Module Index
92
+ <span class="search-toggle"><img src="./images/find.png"
93
+ height="16" width="16" alt="[+]"
94
+ title="show/hide quicksearch" /></span></h3>
95
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
96
+ <fieldset>
97
+ <legend>Quicksearch</legend>
98
+ <input type="text" name="quicksearch" value=""
99
+ class="quicksearch-field" />
100
+ </fieldset>
101
+ </form>
102
+
103
+ <ul class="link-list">
104
+
105
+ <li><a href="./CloudShell.html">CloudShell</a></li>
106
+
107
+ <li><a href="./CloudShell/Context.html">CloudShell::Context</a></li>
108
+
109
+ <li><a href="./Configurator.html">Configurator</a></li>
110
+
111
+ <li><a href="./Formatter.html">Formatter</a></li>
112
+
113
+ <li><a href="./Object.html">Object</a></li>
114
+
115
+ <li><a href="./Parser.html">Parser</a></li>
116
+
117
+ <li><a href="./SwiftClient.html">SwiftClient</a></li>
118
+
119
+ <li><a href="./SwiftManager.html">SwiftManager</a></li>
120
+
121
+ </ul>
122
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
123
+ </div>
124
+
125
+
126
+ </div>
127
+ </div>
128
+
129
+ <div id="documentation">
130
+ <h1 class="class">Configurator</h1>
131
+
132
+ <div id="description" class="description">
133
+ <table class="rdoc-list"><tr><td class="rdoc-term"><p>Author</p></td>
134
+ <td>
135
+ <p>Murali Raju (&lt;murali.raju@appliv.com&gt;)</p>
136
+ </td></tr><tr><td class="rdoc-term"><p>Copyright</p></td>
137
+ <td>
138
+ <p>Copyright © 2011 Murali Raju.</p>
139
+ </td></tr><tr><td class="rdoc-term"><p>License</p></td>
140
+ <td>
141
+ <p>Apache License, Version 2.0</p>
142
+ </td></tr></table>
143
+
144
+ <p>Licensed under the Apache License, Version 2.0 (the “License”); you may not
145
+ use this file except in compliance with the License. You may obtain a copy
146
+ of the License at</p>
147
+
148
+ <p><a
149
+ href="http://www.apache.org/licenses/LICENSE-2.0">www.apache.org/licenses/LICENSE-2.0</a></p>
150
+
151
+ <p>Unless required by applicable law or agreed to in writing, software
152
+ distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
153
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
154
+ License for the specific language governing permissions and limitations
155
+ under the License.</p>
156
+
157
+ </div><!-- description -->
158
+
159
+
160
+
161
+
162
+ <div id="5Buntitled-5D" class="documentation-section">
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <!-- Methods -->
172
+
173
+ <div id="public-instance-method-details" class="method-section section">
174
+ <h3 class="section-header">Public Instance Methods</h3>
175
+
176
+
177
+ <div id="create_auth_config-method" class="method-detail ">
178
+ <a name="method-i-create_auth_config"></a>
179
+
180
+
181
+ <div class="method-heading">
182
+ <span class="method-name">create_auth_config</span><span
183
+ class="method-args">(auth_hash)</span>
184
+ <span class="method-click-advice">click to toggle source</span>
185
+ </div>
186
+
187
+
188
+ <div class="method-description">
189
+
190
+
191
+
192
+
193
+
194
+ <div class="method-source-code" id="create_auth_config-source">
195
+ <pre>
196
+ <span class="ruby-comment"># File lib/configurator.rb, line 21</span>
197
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">create_auth_config</span>(<span class="ruby-identifier">auth_hash</span>)
198
+ <span class="ruby-identifier">my_provider</span> = <span class="ruby-identifier">auth_hash</span>[<span class="ruby-value">:provider</span>]
199
+ <span class="ruby-identifier">my_service</span> = <span class="ruby-identifier">auth_hash</span>[<span class="ruby-value">:service</span>]
200
+ <span class="ruby-identifier">my_secret_access_key</span> = <span class="ruby-identifier">auth_hash</span>[<span class="ruby-value">:secret_access_key</span>]
201
+ <span class="ruby-identifier">my_access_key_id</span> = <span class="ruby-identifier">auth_hash</span>[<span class="ruby-value">:access_key_id</span>]
202
+ <span class="ruby-identifier">my_tag</span> = <span class="ruby-identifier">auth_hash</span>[<span class="ruby-value">:tag</span>]
203
+ <span class="ruby-identifier">my_auth_url_ip</span> = <span class="ruby-identifier">auth_hash</span>[<span class="ruby-value">:url_ip</span>]
204
+
205
+ <span class="ruby-identifier">auth_params</span> = { <span class="ruby-value">:provider</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">my_provider</span>, <span class="ruby-value">:service</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">my_service</span>, <span class="ruby-value">:tag</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">my_tag</span>, <span class="ruby-value">:url_ip</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">my_auth_url_ip</span>,
206
+ <span class="ruby-value">:keys</span> =<span class="ruby-operator">&gt;</span> { <span class="ruby-value">:secret_access_key</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">my_secret_access_key</span>,
207
+ <span class="ruby-value">:access_key_id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">my_access_key_id</span> } }
208
+
209
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-string">&quot;~/.swift-manager/authentication/&quot;</span> )
210
+
211
+
212
+ <span class="ruby-ivar">@auth_config_path</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">home</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/.swift-manager/authentication/auth_config_#{my_tag}.json&quot;</span>
213
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-ivar">@auth_config_path</span>, <span class="ruby-string">&quot;w&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
214
+ <span class="ruby-identifier">f</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-identifier">auth_params</span>)
215
+ <span class="ruby-keyword">end</span>
216
+
217
+ <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>
218
+ <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">print_progress_bar_short</span>
219
+
220
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">''</span>
221
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Adding authentication info to #{@auth_config_path}&quot;</span>.<span class="ruby-identifier">color</span>(<span class="ruby-value">:green</span>)
222
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">''</span>
223
+ <span class="ruby-keyword">else</span>
224
+
225
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">'Looks like this is the first time you are running sling. Let\s setup the env...'</span>.<span class="ruby-identifier">color</span>(<span class="ruby-value">:green</span>)
226
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">''</span>
227
+ <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>
228
+ <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">print_progress_bar_short</span>
229
+
230
+ <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-string">&quot;~/.swift-manager&quot;</span>)
231
+ <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-string">&quot;~/.swift-manager/authentication&quot;</span>)
232
+ <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-string">&quot;~/.swift-manager/log&quot;</span>)
233
+ <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-string">&quot;~/.swift-manager/shell&quot;</span>)
234
+
235
+ <span class="ruby-ivar">@auth_config_path</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">home</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/.swift-manager/authentication/auth_config_#{my_tag}.json&quot;</span>
236
+
237
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-ivar">@auth_config_path</span>, <span class="ruby-string">&quot;w&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
238
+ <span class="ruby-identifier">f</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-identifier">auth_params</span>)
239
+ <span class="ruby-keyword">end</span>
240
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">''</span>
241
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Adding authentication info to #{@auth_config_path}&quot;</span>.<span class="ruby-identifier">color</span>(<span class="ruby-value">:green</span>)
242
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">''</span>
243
+ <span class="ruby-keyword">end</span>
244
+ <span class="ruby-keyword">end</span></pre>
245
+ </div><!-- create_auth_config-source -->
246
+
247
+ </div>
248
+
249
+
250
+
251
+
252
+ </div><!-- create_auth_config-method -->
253
+
254
+
255
+ </div><!-- public-instance-method-details -->
256
+
257
+ </div><!-- 5Buntitled-5D -->
258
+
259
+
260
+ </div><!-- documentation -->
261
+
262
+ <div id="validator-badges">
263
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
264
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
265
+ Rdoc Generator</a> 2</small>.</p>
266
+ </div>
267
+
268
+ </body>
269
+ </html>
270
+