mu 5.7.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/Mu_Gem.html +1591 -0
  2. data/bin/mu +11 -0
  3. data/lib/mu.rb +65 -0
  4. data/lib/mu/api/ddt.rb +233 -0
  5. data/lib/mu/api/homepage.rb +54 -0
  6. data/lib/mu/api/muapi.rb +231 -0
  7. data/lib/mu/api/netconfig.rb +233 -0
  8. data/lib/mu/api/scale.rb +199 -0
  9. data/lib/mu/api/system.rb +40 -0
  10. data/lib/mu/client.rb +31 -0
  11. data/lib/mu/command.rb +28 -0
  12. data/lib/mu/command/api.rb +95 -0
  13. data/lib/mu/command/cmd_appid.rb +486 -0
  14. data/lib/mu/command/cmd_cli.rb +151 -0
  15. data/lib/mu/command/cmd_ddt.rb +449 -0
  16. data/lib/mu/command/cmd_homepage.rb +146 -0
  17. data/lib/mu/command/cmd_muapi.rb +361 -0
  18. data/lib/mu/command/cmd_netconfig.rb +262 -0
  19. data/lib/mu/command/cmd_runscale.rb +533 -0
  20. data/lib/mu/command/cmd_runscenario.rb +258 -0
  21. data/lib/mu/command/cmd_runverify.rb +336 -0
  22. data/lib/mu/command/cmd_scale.rb +333 -0
  23. data/lib/mu/command/cmd_system.rb +127 -0
  24. data/lib/mu/command/curl.rb +246 -0
  25. data/lib/mu/command/help.rb +29 -0
  26. data/lib/mu/curl/error.rb +54 -0
  27. data/lib/mu/curl/verify.rb +137 -0
  28. data/lib/mu/helper.rb +55 -0
  29. data/lib/mu/http_helper.rb +232 -0
  30. data/rdoc/classes/Mu.html +305 -0
  31. data/rdoc/classes/Mu/Client.html +265 -0
  32. data/rdoc/classes/Mu/Command.html +208 -0
  33. data/rdoc/classes/Mu/Command/API.html +524 -0
  34. data/rdoc/classes/Mu/Command/Cmd_appid.html +934 -0
  35. data/rdoc/classes/Mu/Command/Cmd_cli.html +515 -0
  36. data/rdoc/classes/Mu/Command/Cmd_ddt.html +1169 -0
  37. data/rdoc/classes/Mu/Command/Cmd_homepage.html +489 -0
  38. data/rdoc/classes/Mu/Command/Cmd_muapi.html +968 -0
  39. data/rdoc/classes/Mu/Command/Cmd_netconfig.html +743 -0
  40. data/rdoc/classes/Mu/Command/Cmd_runscale.html +970 -0
  41. data/rdoc/classes/Mu/Command/Cmd_runscenario.html +530 -0
  42. data/rdoc/classes/Mu/Command/Cmd_runverify.html +621 -0
  43. data/rdoc/classes/Mu/Command/Cmd_scale.html +939 -0
  44. data/rdoc/classes/Mu/Command/Cmd_system.html +426 -0
  45. data/rdoc/classes/Mu/Command/Curl.html +524 -0
  46. data/rdoc/classes/Mu/Command/Help.html +166 -0
  47. data/rdoc/classes/Mu/Curl.html +116 -0
  48. data/rdoc/classes/Mu/Curl/Error.html +157 -0
  49. data/rdoc/classes/Mu/Curl/Error/Authorize.html +178 -0
  50. data/rdoc/classes/Mu/Curl/Error/Connect.html +149 -0
  51. data/rdoc/classes/Mu/Curl/Error/DNS.html +113 -0
  52. data/rdoc/classes/Mu/Curl/Error/Region.html +160 -0
  53. data/rdoc/classes/Mu/Curl/Error/Status.html +149 -0
  54. data/rdoc/classes/Mu/Curl/Error/Timeout.html +149 -0
  55. data/rdoc/classes/Mu/Curl/Verify.html +282 -0
  56. data/rdoc/classes/Mu/Curl/Verify/Request.html +227 -0
  57. data/rdoc/classes/Mu/Curl/Verify/Response.html +187 -0
  58. data/rdoc/classes/Mu/Curl/Verify/Result.html +188 -0
  59. data/rdoc/classes/Mu/Ddt.html +914 -0
  60. data/rdoc/classes/Mu/Helper.html +308 -0
  61. data/rdoc/classes/Mu/Homepage.html +377 -0
  62. data/rdoc/classes/Mu/HttpHelper.html +639 -0
  63. data/rdoc/classes/Mu/Muapi.html +816 -0
  64. data/rdoc/classes/Mu/Netconfig.html +781 -0
  65. data/rdoc/classes/Mu/Scale.html +832 -0
  66. data/rdoc/classes/Mu/System.html +281 -0
  67. data/rdoc/classes/Object.html +148 -0
  68. data/rdoc/classes/TCTestMu.html +1793 -0
  69. data/rdoc/classes/Test.html +107 -0
  70. data/rdoc/classes/Test/Unit.html +107 -0
  71. data/rdoc/classes/Test/Unit/TestCase.html +113 -0
  72. data/rdoc/created.rid +1 -0
  73. data/rdoc/files/lib/mu/api/ddt_rb.html +101 -0
  74. data/rdoc/files/lib/mu/api/homepage_rb.html +101 -0
  75. data/rdoc/files/lib/mu/api/muapi_rb.html +101 -0
  76. data/rdoc/files/lib/mu/api/netconfig_rb.html +101 -0
  77. data/rdoc/files/lib/mu/api/scale_rb.html +101 -0
  78. data/rdoc/files/lib/mu/api/system_rb.html +101 -0
  79. data/rdoc/files/lib/mu/client_rb.html +101 -0
  80. data/rdoc/files/lib/mu/command/api_rb.html +101 -0
  81. data/rdoc/files/lib/mu/command/cmd_appid_rb.html +119 -0
  82. data/rdoc/files/lib/mu/command/cmd_cli_rb.html +108 -0
  83. data/rdoc/files/lib/mu/command/cmd_ddt_rb.html +117 -0
  84. data/rdoc/files/lib/mu/command/cmd_homepage_rb.html +115 -0
  85. data/rdoc/files/lib/mu/command/cmd_muapi_rb.html +116 -0
  86. data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +116 -0
  87. data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +119 -0
  88. data/rdoc/files/lib/mu/command/cmd_runscenario_rb.html +115 -0
  89. data/rdoc/files/lib/mu/command/cmd_runverify_rb.html +117 -0
  90. data/rdoc/files/lib/mu/command/cmd_scale_rb.html +115 -0
  91. data/rdoc/files/lib/mu/command/cmd_system_rb.html +116 -0
  92. data/rdoc/files/lib/mu/command/curl_rb.html +101 -0
  93. data/rdoc/files/lib/mu/command/help_rb.html +101 -0
  94. data/rdoc/files/lib/mu/command_rb.html +107 -0
  95. data/rdoc/files/lib/mu/curl/error_rb.html +101 -0
  96. data/rdoc/files/lib/mu/curl/verify_rb.html +101 -0
  97. data/rdoc/files/lib/mu/helper_rb.html +101 -0
  98. data/rdoc/files/lib/mu/http_helper_rb.html +101 -0
  99. data/rdoc/files/lib/mu_rb.html +121 -0
  100. data/rdoc/files/test/helper_rb.html +112 -0
  101. data/rdoc/files/test/tc_test_mu_rb.html +111 -0
  102. data/rdoc/fr_class_index.html +68 -0
  103. data/rdoc/fr_file_index.html +55 -0
  104. data/rdoc/fr_method_index.html +374 -0
  105. data/rdoc/index.html +24 -0
  106. data/rdoc/rdoc-style.css +208 -0
  107. data/test/data/app_id_stats.csv +1 -0
  108. data/test/data/data_cgi.msl +94 -0
  109. data/test/data/data_cgi.xml +322 -0
  110. data/test/data/default_test.csv +3 -0
  111. data/test/data/ftp_with_channel.xml +1643 -0
  112. data/test/data/irc.xml +3837 -0
  113. data/test/data/scale_configuration.json +25 -0
  114. data/test/data/test_data_cgi_error.xml +35 -0
  115. data/test/helper.rb +18 -0
  116. data/test/tc_test_mu.rb +716 -0
  117. metadata +322 -0
@@ -0,0 +1,489 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Mu::Command::Cmd_homepage</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Mu::Command::Cmd_homepage</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/mu/command/cmd_homepage_rb.html">
59
+ lib/mu/command/cmd_homepage.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Command
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="method-list">
86
+ <h3 class="section-bar">Methods</h3>
87
+
88
+ <div class="name-list">
89
+ <a href="#M000266">cmd_all</a>&nbsp;&nbsp;
90
+ <a href="#M000265">cmd_help</a>&nbsp;&nbsp;
91
+ <a href="#M000269">cmd_latest_test</a>&nbsp;&nbsp;
92
+ <a href="#M000270">cmd_queue_test</a>&nbsp;&nbsp;
93
+ <a href="#M000267">cmd_recent</a>&nbsp;&nbsp;
94
+ <a href="#M000268">cmd_status</a>&nbsp;&nbsp;
95
+ <a href="#M000273">help</a>&nbsp;&nbsp;
96
+ <a href="#M000272">parse_cli</a>&nbsp;&nbsp;
97
+ <a href="#M000271">setup</a>&nbsp;&nbsp;
98
+ </div>
99
+ </div>
100
+
101
+ </div>
102
+
103
+
104
+ <!-- if includes -->
105
+
106
+ <div id="section">
107
+
108
+
109
+
110
+
111
+
112
+ <div id="attribute-list">
113
+ <h3 class="section-bar">Attributes</h3>
114
+
115
+ <div class="name-list">
116
+ <table>
117
+ <tr class="top-aligned-row context-row">
118
+ <td class="context-item-name">api</td>
119
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
120
+ <td class="context-item-desc"></td>
121
+ </tr>
122
+ <tr class="top-aligned-row context-row">
123
+ <td class="context-item-name">host</td>
124
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
125
+ <td class="context-item-desc"></td>
126
+ </tr>
127
+ <tr class="top-aligned-row context-row">
128
+ <td class="context-item-name">password</td>
129
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
130
+ <td class="context-item-desc"></td>
131
+ </tr>
132
+ <tr class="top-aligned-row context-row">
133
+ <td class="context-item-name">username</td>
134
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
135
+ <td class="context-item-desc"></td>
136
+ </tr>
137
+ </table>
138
+ </div>
139
+ </div>
140
+
141
+
142
+
143
+ <!-- if method_list -->
144
+ <div id="methods">
145
+ <h3 class="section-bar">Public Instance methods</h3>
146
+
147
+ <div id="method-M000266" class="method-detail">
148
+ <a name="M000266"></a>
149
+
150
+ <div class="method-heading">
151
+ <a href="#M000266" class="method-signature">
152
+ <span class="method-name">cmd_all</span><span class="method-args">(argv)</span>
153
+ </a>
154
+ </div>
155
+
156
+ <div class="method-description">
157
+ <p>
158
+ returns all homepage information
159
+ </p>
160
+ <pre>
161
+ * argv = command-line arguments
162
+ </pre>
163
+ <p><a class="source-toggle" href="#"
164
+ onclick="toggleCode('M000266-source');return false;">[Source]</a></p>
165
+ <div class="method-source-code" id="M000266-source">
166
+ <pre>
167
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 17</span>
168
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_all</span> <span class="ruby-identifier">argv</span>
169
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
170
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">all</span>
171
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
172
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
173
+ <span class="ruby-keyword kw">end</span>
174
+ </pre>
175
+ </div>
176
+ </div>
177
+ </div>
178
+
179
+ <div id="method-M000265" class="method-detail">
180
+ <a name="M000265"></a>
181
+
182
+ <div class="method-heading">
183
+ <a href="#M000265" class="method-signature">
184
+ <span class="method-name">cmd_help</span><span class="method-args">(argv)</span>
185
+ </a>
186
+ </div>
187
+
188
+ <div class="method-description">
189
+ <p>
190
+ displays command-line <a href="Cmd_homepage.html#M000273">help</a>
191
+ </p>
192
+ <pre>
193
+ * argv = command-line arguments
194
+ </pre>
195
+ <p><a class="source-toggle" href="#"
196
+ onclick="toggleCode('M000265-source');return false;">[Source]</a></p>
197
+ <div class="method-source-code" id="M000265-source">
198
+ <pre>
199
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 11</span>
200
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_help</span> <span class="ruby-identifier">argv</span>
201
+ <span class="ruby-identifier">help</span>
202
+ <span class="ruby-keyword kw">end</span>
203
+ </pre>
204
+ </div>
205
+ </div>
206
+ </div>
207
+
208
+ <div id="method-M000269" class="method-detail">
209
+ <a name="M000269"></a>
210
+
211
+ <div class="method-heading">
212
+ <a href="#M000269" class="method-signature">
213
+ <span class="method-name">cmd_latest_test</span><span class="method-args">(argv)</span>
214
+ </a>
215
+ </div>
216
+
217
+ <div class="method-description">
218
+ <p>
219
+ returns the latest test
220
+ </p>
221
+ <pre>
222
+ * argv = command-line arguments
223
+ </pre>
224
+ <p><a class="source-toggle" href="#"
225
+ onclick="toggleCode('M000269-source');return false;">[Source]</a></p>
226
+ <div class="method-source-code" id="M000269-source">
227
+ <pre>
228
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 44</span>
229
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_latest_test</span> <span class="ruby-identifier">argv</span>
230
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
231
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">latest_test</span>
232
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
233
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
234
+ <span class="ruby-keyword kw">end</span>
235
+ </pre>
236
+ </div>
237
+ </div>
238
+ </div>
239
+
240
+ <div id="method-M000270" class="method-detail">
241
+ <a name="M000270"></a>
242
+
243
+ <div class="method-heading">
244
+ <a href="#M000270" class="method-signature">
245
+ <span class="method-name">cmd_queue_test</span><span class="method-args">(argv)</span>
246
+ </a>
247
+ </div>
248
+
249
+ <div class="method-description">
250
+ <p>
251
+ returns the queued tests
252
+ </p>
253
+ <pre>
254
+ * argv = command-line arguments
255
+ </pre>
256
+ <p><a class="source-toggle" href="#"
257
+ onclick="toggleCode('M000270-source');return false;">[Source]</a></p>
258
+ <div class="method-source-code" id="M000270-source">
259
+ <pre>
260
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 53</span>
261
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_queue_test</span> <span class="ruby-identifier">argv</span>
262
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
263
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">queue_test</span>
264
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
265
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
266
+ <span class="ruby-keyword kw">end</span>
267
+ </pre>
268
+ </div>
269
+ </div>
270
+ </div>
271
+
272
+ <div id="method-M000267" class="method-detail">
273
+ <a name="M000267"></a>
274
+
275
+ <div class="method-heading">
276
+ <a href="#M000267" class="method-signature">
277
+ <span class="method-name">cmd_recent</span><span class="method-args">(argv)</span>
278
+ </a>
279
+ </div>
280
+
281
+ <div class="method-description">
282
+ <p>
283
+ returns recent homepage information
284
+ </p>
285
+ <pre>
286
+ * argv = command-line arguments
287
+ </pre>
288
+ <p><a class="source-toggle" href="#"
289
+ onclick="toggleCode('M000267-source');return false;">[Source]</a></p>
290
+ <div class="method-source-code" id="M000267-source">
291
+ <pre>
292
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 26</span>
293
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_recent</span> <span class="ruby-identifier">argv</span>
294
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
295
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">recent</span>
296
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
297
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
298
+ <span class="ruby-keyword kw">end</span>
299
+ </pre>
300
+ </div>
301
+ </div>
302
+ </div>
303
+
304
+ <div id="method-M000268" class="method-detail">
305
+ <a name="M000268"></a>
306
+
307
+ <div class="method-heading">
308
+ <a href="#M000268" class="method-signature">
309
+ <span class="method-name">cmd_status</span><span class="method-args">(argv)</span>
310
+ </a>
311
+ </div>
312
+
313
+ <div class="method-description">
314
+ <p>
315
+ returns homepage status information
316
+ </p>
317
+ <pre>
318
+ * argv = command-line arguments
319
+ </pre>
320
+ <p><a class="source-toggle" href="#"
321
+ onclick="toggleCode('M000268-source');return false;">[Source]</a></p>
322
+ <div class="method-source-code" id="M000268-source">
323
+ <pre>
324
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 35</span>
325
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">argv</span>
326
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
327
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">status</span>
328
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
329
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
330
+ <span class="ruby-keyword kw">end</span>
331
+ </pre>
332
+ </div>
333
+ </div>
334
+ </div>
335
+
336
+ <h3 class="section-bar">Private Instance methods</h3>
337
+
338
+ <div id="method-M000273" class="method-detail">
339
+ <a name="M000273"></a>
340
+
341
+ <div class="method-heading">
342
+ <a href="#M000273" class="method-signature">
343
+ <span class="method-name">help</span><span class="method-args">()</span>
344
+ </a>
345
+ </div>
346
+
347
+ <div class="method-description">
348
+ <p><a class="source-toggle" href="#"
349
+ onclick="toggleCode('M000273-source');return false;">[Source]</a></p>
350
+ <div class="method-source-code" id="M000273-source">
351
+ <pre>
352
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 110</span>
353
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>
354
+ <span class="ruby-identifier">helps</span> = [
355
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-h'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--help'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'help on command line options'</span> },
356
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-m'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--mu_string'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'user, password, mu_ip in the form of admin:admin@10.9.8.7'</span> },
357
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-o'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--output'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'output logging to this file'</span> },
358
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-v'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--verbose'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'set Logger::DEBUG level'</span> }
359
+ ]
360
+
361
+ <span class="ruby-identifier">cmds</span> = [
362
+ <span class="ruby-value str">&quot;mu cmd_homepage:all&quot;</span>,
363
+ <span class="ruby-value str">&quot;mu cmd_homepage:help&quot;</span>,
364
+ <span class="ruby-value str">&quot;mu cmd_homepage:latest_test&quot;</span>,
365
+ <span class="ruby-value str">&quot;mu cmd_homepage:queue_test&quot;</span>,
366
+ <span class="ruby-value str">&quot;mu cmd_homepage:recent&quot;</span>,
367
+ <span class="ruby-value str">&quot;mu cmd_homepage:status&quot;</span>,
368
+ ]
369
+
370
+ <span class="ruby-identifier">max_long_size</span> = <span class="ruby-identifier">helps</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">memo</span>, <span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> [ <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">:long</span>].<span class="ruby-identifier">size</span>, <span class="ruby-identifier">memo</span> ].<span class="ruby-identifier">max</span> }
371
+ <span class="ruby-identifier">max_value_size</span> = <span class="ruby-identifier">helps</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">memo</span>, <span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> [ <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">:value</span>].<span class="ruby-identifier">size</span>, <span class="ruby-identifier">memo</span> ].<span class="ruby-identifier">max</span> }
372
+ <span class="ruby-identifier">puts</span>
373
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Usage: mu cmd_homepage:&lt;command&gt; &lt;options&gt;&quot;</span>
374
+ <span class="ruby-identifier">puts</span>
375
+ <span class="ruby-identifier">helps</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span>
376
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;%-*s %*s %-*s %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">max_long_size</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:long</span>], <span class="ruby-value">2</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:short</span>], <span class="ruby-identifier">max_value_size</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:value</span>], <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:help</span>]]
377
+ <span class="ruby-keyword kw">end</span>
378
+ <span class="ruby-identifier">puts</span>
379
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Available Commands&quot;</span>
380
+ <span class="ruby-identifier">puts</span>
381
+ <span class="ruby-identifier">cmds</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">|</span>
382
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">c</span>
383
+ <span class="ruby-keyword kw">end</span>
384
+ <span class="ruby-identifier">puts</span>
385
+ <span class="ruby-keyword kw">end</span>
386
+ </pre>
387
+ </div>
388
+ </div>
389
+ </div>
390
+
391
+ <div id="method-M000272" class="method-detail">
392
+ <a name="M000272"></a>
393
+
394
+ <div class="method-heading">
395
+ <a href="#M000272" class="method-signature">
396
+ <span class="method-name">parse_cli</span><span class="method-args">(argv)</span>
397
+ </a>
398
+ </div>
399
+
400
+ <div class="method-description">
401
+ <p><a class="source-toggle" href="#"
402
+ onclick="toggleCode('M000272-source');return false;">[Source]</a></p>
403
+ <div class="method-source-code" id="M000272-source">
404
+ <pre>
405
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 73</span>
406
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
407
+ <span class="ruby-ivar">@hash</span> = {}
408
+ <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
409
+ <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">empty?</span>
410
+ <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">first</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] <span class="ruby-operator">!=</span> <span class="ruby-value str">'-'</span>
411
+
412
+ <span class="ruby-identifier">k</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
413
+
414
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-h'</span>, <span class="ruby-value str">'--help'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
415
+ <span class="ruby-identifier">help</span>
416
+ <span class="ruby-identifier">exit</span>
417
+ <span class="ruby-keyword kw">end</span>
418
+
419
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-m'</span>, <span class="ruby-value str">'--mu_string'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
420
+ <span class="ruby-identifier">mu_string</span> = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
421
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mu_string</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.+?):(.+?)@(.*)/</span>
422
+ <span class="ruby-ivar">@@mu_admin_user</span> = <span class="ruby-identifier">$1</span>
423
+ <span class="ruby-ivar">@@mu_admin_pass</span> = <span class="ruby-identifier">$2</span>
424
+ <span class="ruby-ivar">@@mu_ip</span> = <span class="ruby-identifier">$3</span>
425
+ <span class="ruby-keyword kw">end</span>
426
+ <span class="ruby-keyword kw">next</span>
427
+ <span class="ruby-keyword kw">end</span>
428
+
429
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-o'</span>, <span class="ruby-value str">'--output'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
430
+ <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>), <span class="ruby-value str">&quot;w&quot;</span>)
431
+ <span class="ruby-keyword kw">next</span>
432
+ <span class="ruby-keyword kw">end</span>
433
+
434
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-v'</span>, <span class="ruby-value str">'--verbose'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
435
+ <span class="ruby-identifier">$log</span>.<span class="ruby-identifier">level</span> = <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
436
+ <span class="ruby-keyword kw">next</span>
437
+ <span class="ruby-keyword kw">end</span>
438
+ <span class="ruby-keyword kw">end</span>
439
+
440
+ <span class="ruby-identifier">args</span>
441
+ <span class="ruby-keyword kw">end</span>
442
+ </pre>
443
+ </div>
444
+ </div>
445
+ </div>
446
+
447
+ <div id="method-M000271" class="method-detail">
448
+ <a name="M000271"></a>
449
+
450
+ <div class="method-heading">
451
+ <a href="#M000271" class="method-signature">
452
+ <span class="method-name">setup</span><span class="method-args">(argv)</span>
453
+ </a>
454
+ </div>
455
+
456
+ <div class="method-description">
457
+ <p><a class="source-toggle" href="#"
458
+ onclick="toggleCode('M000271-source');return false;">[Source]</a></p>
459
+ <div class="method-source-code" id="M000271-source">
460
+ <pre>
461
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_homepage.rb, line 62</span>
462
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
463
+ <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
464
+ <span class="ruby-ivar">@host</span> = (<span class="ruby-ivar">@@mu_ip</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">&quot;127.0.0.1&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_ip</span>
465
+ <span class="ruby-ivar">@username</span> = (<span class="ruby-ivar">@@mu_admin_user</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">&quot;admin&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_admin_user</span>
466
+ <span class="ruby-ivar">@password</span> = (<span class="ruby-ivar">@@mu_admin_pass</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">&quot;admin&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_admin_pass</span>
467
+ <span class="ruby-ivar">@cookie</span> = <span class="ruby-value str">&quot;&quot;</span>
468
+ <span class="ruby-ivar">@response</span> = <span class="ruby-keyword kw">nil</span>
469
+ <span class="ruby-ivar">@api</span> = <span class="ruby-constant">Homepage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@username</span>, <span class="ruby-ivar">@password</span>)
470
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;Created Homepage object to :#{@host}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
471
+ <span class="ruby-keyword kw">end</span>
472
+ </pre>
473
+ </div>
474
+ </div>
475
+ </div>
476
+
477
+
478
+ </div>
479
+
480
+
481
+ </div>
482
+
483
+
484
+ <div id="validator-badges">
485
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
486
+ </div>
487
+
488
+ </body>
489
+ </html>