mu 5.7.8 → 5.7.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. data/lib/mu.rb +1 -1
  2. data/lib/mu/command.rb +18 -2
  3. data/lib/mu/command/cmd_musl.rb +165 -0
  4. data/lib/mu/command/cmd_runscale.rb +12 -8
  5. data/lib/mu/command/help.rb +1 -0
  6. data/lib/mu/har.rb +449 -0
  7. data/lib/mu/libxml.rb +21 -0
  8. data/lib/mu/maker.rb +288 -0
  9. data/lib/mu/xmlizable.rb +559 -0
  10. metadata +78 -267
  11. data/rdoc/Gemfile.html +0 -194
  12. data/rdoc/LICENSE_txt.html +0 -201
  13. data/rdoc/Mu.html +0 -478
  14. data/rdoc/Mu/Client.html +0 -461
  15. data/rdoc/Mu/Command.html +0 -338
  16. data/rdoc/Mu/Command/API.html +0 -844
  17. data/rdoc/Mu/Command/Cmd_appid.html +0 -1341
  18. data/rdoc/Mu/Command/Cmd_cli.html +0 -800
  19. data/rdoc/Mu/Command/Cmd_ddt.html +0 -1612
  20. data/rdoc/Mu/Command/Cmd_homepage.html +0 -762
  21. data/rdoc/Mu/Command/Cmd_muapi.html +0 -1363
  22. data/rdoc/Mu/Command/Cmd_netconfig.html +0 -1077
  23. data/rdoc/Mu/Command/Cmd_runscale.html +0 -1441
  24. data/rdoc/Mu/Command/Cmd_runscenario.html +0 -787
  25. data/rdoc/Mu/Command/Cmd_runverify.html +0 -893
  26. data/rdoc/Mu/Command/Cmd_scale.html +0 -1323
  27. data/rdoc/Mu/Command/Cmd_system.html +0 -677
  28. data/rdoc/Mu/Command/Curl.html +0 -751
  29. data/rdoc/Mu/Command/Help.html +0 -305
  30. data/rdoc/Mu/Curl.html +0 -243
  31. data/rdoc/Mu/Curl/Error.html +0 -304
  32. data/rdoc/Mu/Curl/Error/Authorize.html +0 -355
  33. data/rdoc/Mu/Curl/Error/Connect.html +0 -286
  34. data/rdoc/Mu/Curl/Error/DNS.html +0 -236
  35. data/rdoc/Mu/Curl/Error/Region.html +0 -307
  36. data/rdoc/Mu/Curl/Error/Status.html +0 -286
  37. data/rdoc/Mu/Curl/Error/Timeout.html +0 -286
  38. data/rdoc/Mu/Curl/Verify.html +0 -472
  39. data/rdoc/Mu/Curl/Verify/Request.html +0 -424
  40. data/rdoc/Mu/Curl/Verify/Response.html +0 -372
  41. data/rdoc/Mu/Curl/Verify/Result.html +0 -373
  42. data/rdoc/Mu/Ddt.html +0 -1347
  43. data/rdoc/Mu/Helper.html +0 -517
  44. data/rdoc/Mu/Homepage.html +0 -719
  45. data/rdoc/Mu/HttpHelper.html +0 -890
  46. data/rdoc/Mu/Muapi.html +0 -1226
  47. data/rdoc/Mu/Netconfig.html +0 -1178
  48. data/rdoc/Mu/Scale.html +0 -1359
  49. data/rdoc/Mu/System.html +0 -504
  50. data/rdoc/Object.html +0 -285
  51. data/rdoc/README_rdoc.html +0 -892
  52. data/rdoc/Rakefile.html +0 -257
  53. data/rdoc/TCTestMu.html +0 -2583
  54. data/rdoc/Test.html +0 -235
  55. data/rdoc/Test/Unit.html +0 -235
  56. data/rdoc/Test/Unit/TestCase.html +0 -236
  57. data/rdoc/Test/helper_rb.html +0 -62
  58. data/rdoc/Test/tc_test_mu_rb.html +0 -60
  59. data/rdoc/VERSION.html +0 -179
  60. data/rdoc/bin/mu.html +0 -54
  61. data/rdoc/classes/Mu.html +0 -132
  62. data/rdoc/classes/Mu/Client.html +0 -214
  63. data/rdoc/classes/Mu/Command.html +0 -129
  64. data/rdoc/classes/Mu/Command/API.html +0 -362
  65. data/rdoc/classes/Mu/Command/Cmd_appid.html +0 -238
  66. data/rdoc/classes/Mu/Command/Cmd_cli.html +0 -273
  67. data/rdoc/classes/Mu/Command/Cmd_ddt.html +0 -639
  68. data/rdoc/classes/Mu/Command/Cmd_homepage.html +0 -276
  69. data/rdoc/classes/Mu/Command/Cmd_muapi.html +0 -527
  70. data/rdoc/classes/Mu/Command/Cmd_netconfig.html +0 -399
  71. data/rdoc/classes/Mu/Command/Cmd_runscale.html +0 -220
  72. data/rdoc/classes/Mu/Command/Cmd_runscenario.html +0 -197
  73. data/rdoc/classes/Mu/Command/Cmd_runverify.html +0 -196
  74. data/rdoc/classes/Mu/Command/Cmd_scale.html +0 -511
  75. data/rdoc/classes/Mu/Command/Cmd_system.html +0 -236
  76. data/rdoc/classes/Mu/Command/Curl.html +0 -182
  77. data/rdoc/classes/Mu/Command/Help.html +0 -137
  78. data/rdoc/classes/Mu/Curl.html +0 -116
  79. data/rdoc/classes/Mu/Curl/Error.html +0 -148
  80. data/rdoc/classes/Mu/Curl/Error/Authorize.html +0 -165
  81. data/rdoc/classes/Mu/Curl/Error/Connect.html +0 -139
  82. data/rdoc/classes/Mu/Curl/Error/DNS.html +0 -113
  83. data/rdoc/classes/Mu/Curl/Error/Region.html +0 -150
  84. data/rdoc/classes/Mu/Curl/Error/Status.html +0 -139
  85. data/rdoc/classes/Mu/Curl/Error/Timeout.html +0 -139
  86. data/rdoc/classes/Mu/Curl/Verify.html +0 -207
  87. data/rdoc/classes/Mu/Curl/Verify/Request.html +0 -187
  88. data/rdoc/classes/Mu/Curl/Verify/Response.html +0 -172
  89. data/rdoc/classes/Mu/Curl/Verify/Result.html +0 -172
  90. data/rdoc/classes/Mu/Ddt.html +0 -610
  91. data/rdoc/classes/Mu/Helper.html +0 -308
  92. data/rdoc/classes/Mu/Homepage.html +0 -306
  93. data/rdoc/classes/Mu/HttpHelper.html +0 -393
  94. data/rdoc/classes/Mu/Muapi.html +0 -549
  95. data/rdoc/classes/Mu/Netconfig.html +0 -478
  96. data/rdoc/classes/Mu/Scale.html +0 -580
  97. data/rdoc/classes/Mu/System.html +0 -232
  98. data/rdoc/classes/Object.html +0 -139
  99. data/rdoc/classes/TCTestMu.html +0 -948
  100. data/rdoc/classes/Test.html +0 -107
  101. data/rdoc/classes/Test/Unit.html +0 -107
  102. data/rdoc/classes/Test/Unit/TestCase.html +0 -113
  103. data/rdoc/created.rid +0 -36
  104. data/rdoc/files/lib/mu/api/ddt_rb.html +0 -101
  105. data/rdoc/files/lib/mu/api/homepage_rb.html +0 -101
  106. data/rdoc/files/lib/mu/api/muapi_rb.html +0 -101
  107. data/rdoc/files/lib/mu/api/netconfig_rb.html +0 -101
  108. data/rdoc/files/lib/mu/api/scale_rb.html +0 -101
  109. data/rdoc/files/lib/mu/api/system_rb.html +0 -101
  110. data/rdoc/files/lib/mu/client_rb.html +0 -101
  111. data/rdoc/files/lib/mu/command/api_rb.html +0 -101
  112. data/rdoc/files/lib/mu/command/cmd_appid_rb.html +0 -119
  113. data/rdoc/files/lib/mu/command/cmd_cli_rb.html +0 -108
  114. data/rdoc/files/lib/mu/command/cmd_ddt_rb.html +0 -116
  115. data/rdoc/files/lib/mu/command/cmd_homepage_rb.html +0 -115
  116. data/rdoc/files/lib/mu/command/cmd_muapi_rb.html +0 -115
  117. data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +0 -116
  118. data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +0 -119
  119. data/rdoc/files/lib/mu/command/cmd_runscenario_rb.html +0 -115
  120. data/rdoc/files/lib/mu/command/cmd_runverify_rb.html +0 -118
  121. data/rdoc/files/lib/mu/command/cmd_scale_rb.html +0 -115
  122. data/rdoc/files/lib/mu/command/cmd_system_rb.html +0 -116
  123. data/rdoc/files/lib/mu/command/curl_rb.html +0 -101
  124. data/rdoc/files/lib/mu/command/help_rb.html +0 -101
  125. data/rdoc/files/lib/mu/command_rb.html +0 -107
  126. data/rdoc/files/lib/mu/curl/error_rb.html +0 -101
  127. data/rdoc/files/lib/mu/curl/verify_rb.html +0 -101
  128. data/rdoc/files/lib/mu/helper_rb.html +0 -101
  129. data/rdoc/files/lib/mu/http_helper_rb.html +0 -101
  130. data/rdoc/files/lib/mu_rb.html +0 -121
  131. data/rdoc/files/test/helper_rb.html +0 -112
  132. data/rdoc/files/test/tc_test_mu_rb.html +0 -111
  133. data/rdoc/fr_class_index.html +0 -34
  134. data/rdoc/fr_file_index.html +0 -31
  135. data/rdoc/fr_method_index.html +0 -112
  136. data/rdoc/images/brick.png +0 -0
  137. data/rdoc/images/brick_link.png +0 -0
  138. data/rdoc/images/bug.png +0 -0
  139. data/rdoc/images/bullet_black.png +0 -0
  140. data/rdoc/images/bullet_toggle_minus.png +0 -0
  141. data/rdoc/images/bullet_toggle_plus.png +0 -0
  142. data/rdoc/images/date.png +0 -0
  143. data/rdoc/images/find.png +0 -0
  144. data/rdoc/images/loadingAnimation.gif +0 -0
  145. data/rdoc/images/macFFBgHack.png +0 -0
  146. data/rdoc/images/package.png +0 -0
  147. data/rdoc/images/page_green.png +0 -0
  148. data/rdoc/images/page_white_text.png +0 -0
  149. data/rdoc/images/page_white_width.png +0 -0
  150. data/rdoc/images/plugin.png +0 -0
  151. data/rdoc/images/ruby.png +0 -0
  152. data/rdoc/images/tag_green.png +0 -0
  153. data/rdoc/images/wrench.png +0 -0
  154. data/rdoc/images/wrench_orange.png +0 -0
  155. data/rdoc/images/zoom.png +0 -0
  156. data/rdoc/index.html +0 -884
  157. data/rdoc/js/darkfish.js +0 -116
  158. data/rdoc/js/jquery.js +0 -32
  159. data/rdoc/js/quicksearch.js +0 -114
  160. data/rdoc/js/thickbox-compressed.js +0 -10
  161. data/rdoc/lib/mu/api/ddt_rb.html +0 -52
  162. data/rdoc/lib/mu/api/homepage_rb.html +0 -52
  163. data/rdoc/lib/mu/api/muapi_rb.html +0 -52
  164. data/rdoc/lib/mu/api/netconfig_rb.html +0 -52
  165. data/rdoc/lib/mu/api/scale_rb.html +0 -52
  166. data/rdoc/lib/mu/api/system_rb.html +0 -52
  167. data/rdoc/lib/mu/client_rb.html +0 -52
  168. data/rdoc/lib/mu/command/api_rb.html +0 -52
  169. data/rdoc/lib/mu/command/cmd_appid_rb.html +0 -62
  170. data/rdoc/lib/mu/command/cmd_cli_rb.html +0 -55
  171. data/rdoc/lib/mu/command/cmd_ddt_rb.html +0 -60
  172. data/rdoc/lib/mu/command/cmd_homepage_rb.html +0 -57
  173. data/rdoc/lib/mu/command/cmd_muapi_rb.html +0 -59
  174. data/rdoc/lib/mu/command/cmd_netconfig_rb.html +0 -58
  175. data/rdoc/lib/mu/command/cmd_runscale_rb.html +0 -62
  176. data/rdoc/lib/mu/command/cmd_runscenario_rb.html +0 -57
  177. data/rdoc/lib/mu/command/cmd_runverify_rb.html +0 -61
  178. data/rdoc/lib/mu/command/cmd_scale_rb.html +0 -58
  179. data/rdoc/lib/mu/command/cmd_system_rb.html +0 -59
  180. data/rdoc/lib/mu/command/curl_rb.html +0 -52
  181. data/rdoc/lib/mu/command/help_rb.html +0 -52
  182. data/rdoc/lib/mu/command_rb.html +0 -55
  183. data/rdoc/lib/mu/curl/error_rb.html +0 -52
  184. data/rdoc/lib/mu/curl/verify_rb.html +0 -52
  185. data/rdoc/lib/mu/helper_rb.html +0 -52
  186. data/rdoc/lib/mu/http_helper_rb.html +0 -52
  187. data/rdoc/lib/mu_rb.html +0 -80
  188. data/rdoc/rdoc-style.css +0 -208
  189. data/rdoc/rdoc.css +0 -706
  190. data/test/data/app_id_stats.csv +0 -1
  191. data/test/data/app_id_status.json +0 -156
  192. data/test/data/data_cgi.msl +0 -94
  193. data/test/data/data_cgi.xml +0 -322
  194. data/test/data/default_test.csv +0 -3
  195. data/test/data/ftp_with_channel.xml +0 -1643
  196. data/test/data/irc.xml +0 -3837
  197. data/test/data/scale.json +0 -25
  198. data/test/data/test_data_cgi_error.xml +0 -35
@@ -1,751 +0,0 @@
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: Mu::Command::Curl</title>
9
-
10
- <link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />
11
-
12
- <script src="../../js/jquery.js" type="text/javascript"
13
- charset="utf-8"></script>
14
- <script src="../../js/thickbox-compressed.js" type="text/javascript"
15
- charset="utf-8"></script>
16
- <script src="../../js/quicksearch.js" type="text/javascript"
17
- charset="utf-8"></script>
18
- <script src="../../js/darkfish.js" type="text/javascript"
19
- charset="utf-8"></script>
20
-
21
- </head>
22
- <body class="class">
23
-
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
27
- <h3 class="section-header">
28
- <a href="../../index.html">Home</a>
29
- <a href="../../index.html#classes">Classes</a>
30
- <a href="../../index.html#methods">Methods</a>
31
- </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="file-metadata">
36
- <div id="file-list-section" class="section">
37
- <h3 class="section-header">In Files</h3>
38
- <div class="section-body">
39
- <ul>
40
-
41
- <li><a href="../../lib/mu/command/curl_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
- class="thickbox" title="lib/mu/command/curl.rb">lib/mu/command/curl.rb</a></li>
43
-
44
- </ul>
45
- </div>
46
- </div>
47
-
48
-
49
- </div>
50
-
51
- <div id="class-metadata">
52
-
53
- <!-- Parent Class -->
54
-
55
- <div id="parent-class-section" class="section">
56
- <h3 class="section-header">Parent</h3>
57
-
58
- <p class="link"><a href="../Command.html">Mu::Command</a></p>
59
-
60
- </div>
61
-
62
-
63
- <!-- Namespace Contents -->
64
-
65
-
66
- <!-- Method Quickref -->
67
-
68
- <div id="method-list-section" class="section">
69
- <h3 class="section-header">Methods</h3>
70
- <ul class="link-list">
71
-
72
- <li><a href="#method-i-authorize_error">#authorize_error</a></li>
73
-
74
- <li><a href="#method-i-cmd_default">#cmd_default</a></li>
75
-
76
- <li><a href="#method-i-cmd_help">#cmd_help</a></li>
77
-
78
- <li><a href="#method-i-cmd_run">#cmd_run</a></li>
79
-
80
- <li><a href="#method-i-help">#help</a></li>
81
-
82
- <li><a href="#method-i-parse_cli">#parse_cli</a></li>
83
-
84
- <li><a href="#method-i-print_verify_result">#print_verify_result</a></li>
85
-
86
- <li><a href="#method-i-verify">#verify</a></li>
87
-
88
- </ul>
89
- </div>
90
-
91
-
92
- <!-- Included Modules -->
93
-
94
- </div>
95
-
96
- <div id="project-metadata">
97
-
98
-
99
- <div id="fileindex-section" class="section project-section">
100
- <h3 class="section-header">Files</h3>
101
- <ul>
102
-
103
- <li class="file"><a href="../../Gemfile.html">Gemfile</a></li>
104
-
105
- <li class="file"><a href="../../LICENSE_txt.html">LICENSE.txt</a></li>
106
-
107
- <li class="file"><a href="../../README_rdoc.html">README.rdoc</a></li>
108
-
109
- <li class="file"><a href="../../Rakefile.html">Rakefile</a></li>
110
-
111
- <li class="file"><a href="../../VERSION.html">VERSION</a></li>
112
-
113
- </ul>
114
- </div>
115
-
116
-
117
- <div id="classindex-section" class="section project-section">
118
- <h3 class="section-header">Class Index
119
- <span class="search-toggle"><img src="../../images/find.png"
120
- height="16" width="16" alt="[+]"
121
- title="show/hide quicksearch" /></span></h3>
122
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
123
- <fieldset>
124
- <legend>Quicksearch</legend>
125
- <input type="text" name="quicksearch" value=""
126
- class="quicksearch-field" />
127
- </fieldset>
128
- </form>
129
-
130
- <ul class="link-list">
131
-
132
- <li><a href="../../Mu.html">Mu</a></li>
133
-
134
- <li><a href="../../Mu/Client.html">Mu::Client</a></li>
135
-
136
- <li><a href="../../Mu/Command.html">Mu::Command</a></li>
137
-
138
- <li><a href="../../Mu/Command/API.html">Mu::Command::API</a></li>
139
-
140
- <li><a href="../../Mu/Command/API.html">Mu::Command::API</a></li>
141
-
142
- <li><a href="../../Mu/Command/Cmd_appid.html">Mu::Command::Cmd_appid</a></li>
143
-
144
- <li><a href="../../Mu/Command/Cmd_cli.html">Mu::Command::Cmd_cli</a></li>
145
-
146
- <li><a href="../../Mu/Command/Cmd_ddt.html">Mu::Command::Cmd_ddt</a></li>
147
-
148
- <li><a href="../../Mu/Command/Cmd_homepage.html">Mu::Command::Cmd_homepage</a></li>
149
-
150
- <li><a href="../../Mu/Command/Cmd_muapi.html">Mu::Command::Cmd_muapi</a></li>
151
-
152
- <li><a href="../../Mu/Command/Cmd_netconfig.html">Mu::Command::Cmd_netconfig</a></li>
153
-
154
- <li><a href="../../Mu/Command/Cmd_runscale.html">Mu::Command::Cmd_runscale</a></li>
155
-
156
- <li><a href="../../Mu/Command/Cmd_runscenario.html">Mu::Command::Cmd_runscenario</a></li>
157
-
158
- <li><a href="../../Mu/Command/Cmd_runverify.html">Mu::Command::Cmd_runverify</a></li>
159
-
160
- <li><a href="../../Mu/Command/Cmd_scale.html">Mu::Command::Cmd_scale</a></li>
161
-
162
- <li><a href="../../Mu/Command/Cmd_system.html">Mu::Command::Cmd_system</a></li>
163
-
164
- <li><a href="../../Mu/Command/Curl.html">Mu::Command::Curl</a></li>
165
-
166
- <li><a href="../../Mu/Command/Help.html">Mu::Command::Help</a></li>
167
-
168
- <li><a href="../../Mu/Curl.html">Mu::Curl</a></li>
169
-
170
- <li><a href="../../Mu/Curl/Error.html">Mu::Curl::Error</a></li>
171
-
172
- <li><a href="../../Mu/Curl/Error/Authorize.html">Mu::Curl::Error::Authorize</a></li>
173
-
174
- <li><a href="../../Mu/Curl/Error/Connect.html">Mu::Curl::Error::Connect</a></li>
175
-
176
- <li><a href="../../Mu/Curl/Error/DNS.html">Mu::Curl::Error::DNS</a></li>
177
-
178
- <li><a href="../../Mu/Curl/Error/Region.html">Mu::Curl::Error::Region</a></li>
179
-
180
- <li><a href="../../Mu/Curl/Error/Status.html">Mu::Curl::Error::Status</a></li>
181
-
182
- <li><a href="../../Mu/Curl/Error/Timeout.html">Mu::Curl::Error::Timeout</a></li>
183
-
184
- <li><a href="../../Mu/Curl/Verify.html">Mu::Curl::Verify</a></li>
185
-
186
- <li><a href="../../Mu/Curl/Verify/Request.html">Mu::Curl::Verify::Request</a></li>
187
-
188
- <li><a href="../../Mu/Curl/Verify/Response.html">Mu::Curl::Verify::Response</a></li>
189
-
190
- <li><a href="../../Mu/Curl/Verify/Result.html">Mu::Curl::Verify::Result</a></li>
191
-
192
- <li><a href="../../Mu/Ddt.html">Mu::Ddt</a></li>
193
-
194
- <li><a href="../../Mu/Helper.html">Mu::Helper</a></li>
195
-
196
- <li><a href="../../Mu/Homepage.html">Mu::Homepage</a></li>
197
-
198
- <li><a href="../../Mu/HttpHelper.html">Mu::HttpHelper</a></li>
199
-
200
- <li><a href="../../Mu/Muapi.html">Mu::Muapi</a></li>
201
-
202
- <li><a href="../../Mu/Netconfig.html">Mu::Netconfig</a></li>
203
-
204
- <li><a href="../../Mu/Scale.html">Mu::Scale</a></li>
205
-
206
- <li><a href="../../Mu/System.html">Mu::System</a></li>
207
-
208
- <li><a href="../../Test.html">Test</a></li>
209
-
210
- <li><a href="../../Test/Unit.html">Test::Unit</a></li>
211
-
212
- <li><a href="../../Test/Unit/TestCase.html">Test::Unit::TestCase</a></li>
213
-
214
- <li><a href="../../Object.html">Object</a></li>
215
-
216
- <li><a href="../../TCTestMu.html">TCTestMu</a></li>
217
-
218
- </ul>
219
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
220
- </div>
221
-
222
-
223
- </div>
224
- </div>
225
-
226
- <div id="documentation">
227
- <h1 class="class">Mu::Command::Curl</h1>
228
-
229
- <div id="description">
230
-
231
- </div>
232
-
233
- <!-- Constants -->
234
-
235
-
236
- <!-- Attributes -->
237
-
238
-
239
- <!-- Methods -->
240
-
241
- <div id="public-instance-method-details" class="method-section section">
242
- <h3 class="section-header">Public Instance Methods</h3>
243
-
244
-
245
- <div id="authorize-error-method" class="method-detail ">
246
- <a name="method-i-authorize_error"></a>
247
-
248
- <div class="method-heading">
249
-
250
- <span class="method-name">authorize_error</span><span
251
- class="method-args">(e)</span>
252
- <span class="method-click-advice">click to toggle source</span>
253
-
254
- </div>
255
-
256
- <div class="method-description">
257
-
258
-
259
-
260
-
261
-
262
- <div class="method-source-code"
263
- id="authorize-error-source">
264
- <pre>
265
- <span class="ruby-comment cmt"># File lib/mu/command/curl.rb, line 8</span>
266
- 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authorize_error</span> <span class="ruby-identifier">e</span>
267
- 9: <span class="ruby-identifier">base_url</span> = <span class="ruby-node">&quot;#{e.scheme}://#{e.host}:#{e.port}&quot;</span>
268
- 10: <span class="ruby-identifier">puts</span>
269
- 11: <span class="ruby-identifier">error</span> <span class="ruby-node">&quot;You haven't verified that you are the dev/ops for #{e.host}&quot;</span>
270
- 12: <span class="ruby-identifier">puts</span>
271
- 13: <span class="ruby-keyword kw">end</span></pre>
272
- </div>
273
-
274
- </div>
275
-
276
-
277
-
278
-
279
- </div>
280
-
281
-
282
- <div id="cmd-default-method" class="method-detail method-alias">
283
- <a name="method-i-cmd_default"></a>
284
-
285
- <div class="method-heading">
286
-
287
- <span class="method-name">cmd_default</span><span
288
- class="method-args">(argv)</span>
289
- <span class="method-click-advice">click to toggle source</span>
290
-
291
- </div>
292
-
293
- <div class="method-description">
294
-
295
-
296
-
297
-
298
-
299
- </div>
300
-
301
-
302
-
303
-
304
- <div class="aliases">
305
- Alias for: <a href="Curl.html#method-i-cmd_run">cmd_run</a>
306
- </div>
307
-
308
- </div>
309
-
310
-
311
- <div id="cmd-help-method" class="method-detail ">
312
- <a name="method-i-cmd_help"></a>
313
-
314
- <div class="method-heading">
315
-
316
- <span class="method-name">cmd_help</span><span
317
- class="method-args">(argv)</span>
318
- <span class="method-click-advice">click to toggle source</span>
319
-
320
- </div>
321
-
322
- <div class="method-description">
323
-
324
-
325
-
326
-
327
-
328
- <div class="method-source-code"
329
- id="cmd-help-source">
330
- <pre>
331
- <span class="ruby-comment cmt"># File lib/mu/command/curl.rb, line 4</span>
332
- 4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_help</span> <span class="ruby-identifier">argv</span>
333
- 5: <span class="ruby-identifier">help</span>
334
- 6: <span class="ruby-keyword kw">end</span></pre>
335
- </div>
336
-
337
- </div>
338
-
339
-
340
-
341
-
342
- </div>
343
-
344
-
345
- <div id="cmd-run-method" class="method-detail ">
346
- <a name="method-i-cmd_run"></a>
347
-
348
- <div class="method-heading">
349
-
350
- <span class="method-name">cmd_run</span><span
351
- class="method-args">(argv)</span>
352
- <span class="method-click-advice">click to toggle source</span>
353
-
354
- </div>
355
-
356
- <div class="method-description">
357
-
358
-
359
-
360
-
361
-
362
- <div class="method-source-code"
363
- id="cmd-run-source">
364
- <pre>
365
- <span class="ruby-comment cmt"># File lib/mu/command/curl.rb, line 15</span>
366
- 15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">argv</span>
367
- 16: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
368
- 17: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-value str">'help'</span>]
369
- 18: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">help</span>
370
- 19: <span class="ruby-keyword kw">end</span>
371
- 20:
372
- 21: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">args</span>[<span class="ruby-value str">'pattern'</span>]
373
- 22: <span class="ruby-identifier">verify</span> <span class="ruby-identifier">args</span>
374
- 23: <span class="ruby-keyword kw">return</span>
375
- 24: <span class="ruby-keyword kw">end</span>
376
- 25: <span class="ruby-keyword kw">end</span></pre>
377
- </div>
378
-
379
- </div>
380
-
381
-
382
- <div class="aliases">
383
- Also aliased as: <a href="Curl.html#method-i-cmd_default">cmd_default</a>
384
- </div>
385
-
386
-
387
-
388
- </div>
389
-
390
-
391
- </div>
392
-
393
- <div id="private-instance-method-details" class="method-section section">
394
- <h3 class="section-header">Private Instance Methods</h3>
395
-
396
-
397
- <div id="help-method" class="method-detail ">
398
- <a name="method-i-help"></a>
399
-
400
- <div class="method-heading">
401
-
402
- <span class="method-name">help</span><span
403
- class="method-args">()</span>
404
- <span class="method-click-advice">click to toggle source</span>
405
-
406
- </div>
407
-
408
- <div class="method-description">
409
-
410
-
411
-
412
-
413
-
414
- <div class="method-source-code"
415
- id="help-source">
416
- <pre>
417
- <span class="ruby-comment cmt"># File lib/mu/command/curl.rb, line 87</span>
418
- 87: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>
419
- 88: <span class="ruby-identifier">helps</span> = [
420
- 89: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-A'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--user-agent'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'User-Agent to send to server'</span> },
421
- 90: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-b'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--cookie'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'name=&lt;string&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Cookie to send to the server (multiple)'</span> },
422
- 91: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-d'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--data'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Data to send in a PUT or POST request'</span> },
423
- 92: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-D'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--dump-header'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;file&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Print the request/response headers'</span> },
424
- 93: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-e'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--referer'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Referer URL'</span> },
425
- 94: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-h'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--help'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Help on command line options'</span> },
426
- 95: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-H'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--header'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Custom header to pass to server'</span> },
427
- 96: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-p'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--pattern'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;s&gt;-&lt;e&gt;:&lt;d&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Ramp from s to e concurrent requests in d secs'</span> },
428
- 97: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-r'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--region'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Choose one of us-east or us-west'</span> },
429
- 98: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-s'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--status'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;number&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Assert on the HTTP response status code'</span> },
430
- 99: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-T'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--timeout'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;ms&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Wait time for both connect and responses'</span> },
431
- 100: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-u'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--user'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;user[:pass]&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'User and password for authentication'</span> },
432
- 101: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-X'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--request'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Request method to use (GET, HEAD, PUT, etc.)'</span> },
433
- 102: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-v'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--verbose'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Print the request/response headers'</span> },
434
- 103: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-1'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--tlsv1'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Use TLSv1 (SSL)'</span> },
435
- 104: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-2'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--sslv2'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Use SSLv2 (SSL)'</span> },
436
- 105: { <span class="ruby-value">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-3'</span>, <span class="ruby-value">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--sslv3'</span>, <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-value">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Use SSLv3 (SSL)'</span> }
437
- 106: ]
438
- 107:
439
- 108: <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-value">:long</span>].<span class="ruby-identifier">size</span>, <span class="ruby-identifier">memo</span> ].<span class="ruby-identifier">max</span> }
440
- 109: <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-value">:value</span>].<span class="ruby-identifier">size</span>, <span class="ruby-identifier">memo</span> ].<span class="ruby-identifier">max</span> }
441
- 110: <span class="ruby-identifier">puts</span>
442
- 111: <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;Usage: mu curl &lt;options&gt; &lt;url&gt;&quot;</span>
443
- 112: <span class="ruby-identifier">puts</span>
444
- 113: <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>
445
- 114: <span class="ruby-identifier">msg</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-value">:long</span>], <span class="ruby-value">2</span>, <span class="ruby-identifier">h</span>[<span class="ruby-value">:short</span>], <span class="ruby-identifier">max_value_size</span>, <span class="ruby-identifier">h</span>[<span class="ruby-value">:value</span>], <span class="ruby-identifier">h</span>[<span class="ruby-value">:help</span>]]
446
- 115: <span class="ruby-keyword kw">end</span>
447
- 116: <span class="ruby-identifier">puts</span>
448
- 117: <span class="ruby-keyword kw">end</span></pre>
449
- </div>
450
-
451
- </div>
452
-
453
-
454
-
455
-
456
- </div>
457
-
458
-
459
- <div id="parse-cli-method" class="method-detail ">
460
- <a name="method-i-parse_cli"></a>
461
-
462
- <div class="method-heading">
463
-
464
- <span class="method-name">parse_cli</span><span
465
- class="method-args">(argv)</span>
466
- <span class="method-click-advice">click to toggle source</span>
467
-
468
- </div>
469
-
470
- <div class="method-description">
471
-
472
-
473
-
474
-
475
-
476
- <div class="method-source-code"
477
- id="parse-cli-source">
478
- <pre>
479
- <span class="ruby-comment cmt"># File lib/mu/command/curl.rb, line 119</span>
480
- 119: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
481
- 120: <span class="ruby-identifier">hash</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
482
- 121: <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>
483
- 122: <span class="ruby-keyword kw">break</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>
484
- 123:
485
- 124: <span class="ruby-identifier">k</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
486
- 125: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-A'</span>, <span class="ruby-value str">'--user-agent'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
487
- 126: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'user-agent'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
488
- 127: <span class="ruby-keyword kw">next</span>
489
- 128: <span class="ruby-keyword kw">end</span>
490
- 129:
491
- 130: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-b'</span>, <span class="ruby-value str">'--cookie'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
492
- 131: <span class="ruby-comment cmt"># TODO: support cookie jars</span>
493
- 132: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'cookies'</span>] <span class="ruby-operator">||=</span> []
494
- 133: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'cookies'</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
495
- 134: <span class="ruby-keyword kw">next</span>
496
- 135: <span class="ruby-keyword kw">end</span>
497
- 136:
498
- 137: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-d'</span>, <span class="ruby-value str">'--data'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
499
- 138: <span class="ruby-comment cmt"># TODO: Read from a file using the @syntax</span>
500
- 139: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'content'</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
501
- 140: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'content'</span>][<span class="ruby-value str">'data'</span>] <span class="ruby-operator">||=</span> []
502
- 141: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'content'</span>][<span class="ruby-value str">'data'</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
503
- 142: <span class="ruby-keyword kw">next</span>
504
- 143: <span class="ruby-keyword kw">end</span>
505
- 144:
506
- 145: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-D'</span>, <span class="ruby-value str">'--dump-header'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
507
- 146: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'dump-header'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
508
- 147: <span class="ruby-keyword kw">next</span>
509
- 148: <span class="ruby-keyword kw">end</span>
510
- 149:
511
- 150: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-e'</span>, <span class="ruby-value str">'--referer'</span>].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
512
- 151: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'referer'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
513
- 152: <span class="ruby-keyword kw">next</span>
514
- 153: <span class="ruby-keyword kw">end</span>
515
- 154:
516
- 155: <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>
517
- 156: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'help'</span>] = <span class="ruby-keyword kw">true</span>
518
- 157: <span class="ruby-keyword kw">next</span>
519
- 158: <span class="ruby-keyword kw">end</span>
520
- 159:
521
- 160: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-H'</span>, <span class="ruby-value str">'--header'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
522
- 161: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'headers'</span>] <span class="ruby-operator">||=</span> []
523
- 162: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'headers'</span>].<span class="ruby-identifier">push</span> <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
524
- 163: <span class="ruby-keyword kw">next</span>
525
- 164: <span class="ruby-keyword kw">end</span>
526
- 165:
527
- 166: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-p'</span>, <span class="ruby-value str">'--pattern'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
528
- 167: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
529
- 168: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-regexp re">/^(\d+)-(\d+):(\d+)$/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">v</span>
530
- 169: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;invalid ramp pattern&quot;</span>
531
- 170: <span class="ruby-keyword kw">end</span>
532
- 171: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'pattern'</span>] = {
533
- 172: <span class="ruby-value str">'iterations'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>,
534
- 173: <span class="ruby-value str">'intervals'</span> =<span class="ruby-operator">&gt;</span> [{
535
- 174: <span class="ruby-value str">'iterations'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>,
536
- 175: <span class="ruby-value str">'start'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>,
537
- 176: <span class="ruby-value str">'end'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">$2</span>.<span class="ruby-identifier">to_i</span>,
538
- 177: <span class="ruby-value str">'duration'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">$3</span>.<span class="ruby-identifier">to_i</span>
539
- 178: }]
540
- 179: }
541
- 180: <span class="ruby-keyword kw">next</span>
542
- 181: <span class="ruby-keyword kw">end</span>
543
- 182:
544
- 183: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-r'</span>, <span class="ruby-value str">'--region'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
545
- 184: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
546
- 185: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">v</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;us-west&quot;</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-operator">!</span><span class="ruby-identifier">v</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;us-east&quot;</span>)
547
- 186: <span class="ruby-identifier">raise</span> <span class="ruby-value str">'region must be one of us-west or us-east'</span>
548
- 187: <span class="ruby-keyword kw">end</span>
549
- 188: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'region'</span>] = <span class="ruby-identifier">v</span>
550
- 189: <span class="ruby-keyword kw">next</span>
551
- 190: <span class="ruby-keyword kw">end</span>
552
- 191:
553
- 192: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-s'</span>, <span class="ruby-value str">'--status'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
554
- 193: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'status'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>).<span class="ruby-identifier">to_i</span>
555
- 194: <span class="ruby-keyword kw">next</span>
556
- 195: <span class="ruby-keyword kw">end</span>
557
- 196:
558
- 197: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-T'</span>, <span class="ruby-value str">'--timeout'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
559
- 198: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'timeout'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>).<span class="ruby-identifier">to_i</span>
560
- 199: <span class="ruby-keyword kw">next</span>
561
- 200: <span class="ruby-keyword kw">end</span>
562
- 201:
563
- 202: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-u'</span>, <span class="ruby-value str">'--user'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
564
- 203: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'user'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
565
- 204: <span class="ruby-keyword kw">next</span>
566
- 205: <span class="ruby-keyword kw">end</span>
567
- 206:
568
- 207: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-X'</span>, <span class="ruby-value str">'--request'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
569
- 208: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'request'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
570
- 209: <span class="ruby-keyword kw">next</span>
571
- 210: <span class="ruby-keyword kw">end</span>
572
- 211:
573
- 212: <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>
574
- 213: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'verbose'</span>] = <span class="ruby-keyword kw">true</span>
575
- 214: <span class="ruby-keyword kw">next</span>
576
- 215: <span class="ruby-keyword kw">end</span>
577
- 216:
578
- 217: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-1'</span>, <span class="ruby-value str">'--tlsv1'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
579
- 218: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'ssl'</span>] = <span class="ruby-value str">'tlsv1'</span>
580
- 219: <span class="ruby-keyword kw">next</span>
581
- 220: <span class="ruby-keyword kw">end</span>
582
- 221:
583
- 222: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-2'</span>, <span class="ruby-value str">'--sslv2'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
584
- 223: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'ssl'</span>] = <span class="ruby-value str">'sslv2'</span>
585
- 224: <span class="ruby-keyword kw">next</span>
586
- 225: <span class="ruby-keyword kw">end</span>
587
- 226:
588
- 227: <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-3'</span>, <span class="ruby-value str">'--sslv3'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
589
- 228: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'ssl'</span>] = <span class="ruby-value str">'sslv2'</span>
590
- 229: <span class="ruby-keyword kw">next</span>
591
- 230: <span class="ruby-keyword kw">end</span>
592
- 231:
593
- 232: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unknown option #{k}&quot;</span>
594
- 233: <span class="ruby-keyword kw">end</span>
595
- 234:
596
- 235: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'help'</span>]
597
- 236: <span class="ruby-identifier">url</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
598
- 237: <span class="ruby-identifier">raise</span> <span class="ruby-value str">'no URL specified!'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">nil?</span>
599
- 238: <span class="ruby-identifier">hash</span>[<span class="ruby-value str">'url'</span>] = <span class="ruby-identifier">url</span>
600
- 239: <span class="ruby-keyword kw">end</span>
601
- 240:
602
- 241: <span class="ruby-identifier">hash</span>
603
- 242: <span class="ruby-keyword kw">end</span></pre>
604
- </div>
605
-
606
- </div>
607
-
608
-
609
-
610
-
611
- </div>
612
-
613
-
614
- <div id="print-verify-result-method" class="method-detail ">
615
- <a name="method-i-print_verify_result"></a>
616
-
617
- <div class="method-heading">
618
-
619
- <span class="method-name">print_verify_result</span><span
620
- class="method-args">(args, result)</span>
621
- <span class="method-click-advice">click to toggle source</span>
622
-
623
- </div>
624
-
625
- <div class="method-description">
626
-
627
-
628
-
629
-
630
-
631
- <div class="method-source-code"
632
- id="print-verify-result-source">
633
- <pre>
634
- <span class="ruby-comment cmt"># File lib/mu/command/curl.rb, line 44</span>
635
- 44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_verify_result</span> <span class="ruby-identifier">args</span>, <span class="ruby-identifier">result</span>
636
- 45: <span class="ruby-identifier">rtt</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">duration</span>
637
- 46: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rtt</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">1.0</span>
638
- 47: <span class="ruby-identifier">rtt</span> = (<span class="ruby-identifier">rtt</span> * <span class="ruby-value">1000</span>).<span class="ruby-identifier">floor</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">' ms'</span>;
639
- 48: <span class="ruby-keyword kw">else</span>
640
- 49: <span class="ruby-identifier">rtt</span> = (<span class="ruby-value str">&quot;%.2f&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">rtt</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">' sec'</span>;
641
- 50: <span class="ruby-keyword kw">end</span>
642
- 51:
643
- 52: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-&quot;</span> * <span class="ruby-value">70</span>
644
- 53: <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;#{result.region}: Response time of #{rtt}&quot;</span>
645
- 54: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-&quot;</span> * <span class="ruby-value">70</span>
646
- 55: <span class="ruby-identifier">puts</span>
647
- 56:
648
- 57: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-value str">'dump-header'</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">args</span>[<span class="ruby-value str">'verbose'</span>]
649
- 58: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;&gt; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">line</span>
650
- 59: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;&gt; #{k}: #{v}\r\n&quot;</span> }
651
- 60: <span class="ruby-identifier">puts</span>
652
- 61:
653
- 62: <span class="ruby-identifier">content</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">content</span>
654
- 63: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">content</span>.<span class="ruby-identifier">empty?</span>
655
- 64: <span class="ruby-keyword kw">if</span> <span class="ruby-regexp re">/^[[:print:]]+$/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">content</span>
656
- 65: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">content</span>
657
- 66: <span class="ruby-keyword kw">else</span>
658
- 67: <span class="ruby-identifier">puts</span> <span class="ruby-constant">Hexy</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">content</span>).<span class="ruby-identifier">to_s</span>
659
- 68: <span class="ruby-keyword kw">end</span>
660
- 69: <span class="ruby-identifier">puts</span>
661
- 70: <span class="ruby-keyword kw">end</span>
662
- 71:
663
- 72: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;&lt; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">response</span>.<span class="ruby-identifier">line</span>
664
- 73: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;&gt; #{k}: #{v}\r\n&quot;</span> }
665
- 74: <span class="ruby-identifier">puts</span>
666
- 75: <span class="ruby-keyword kw">end</span>
667
- 76:
668
- 77: <span class="ruby-identifier">content</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">response</span>.<span class="ruby-identifier">content</span>
669
- 78: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">content</span>.<span class="ruby-identifier">empty?</span>
670
- 79: <span class="ruby-keyword kw">if</span> <span class="ruby-regexp re">/^[[:print:]]+$/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">content</span>
671
- 80: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">content</span>
672
- 81: <span class="ruby-keyword kw">else</span>
673
- 82: <span class="ruby-identifier">puts</span> <span class="ruby-constant">Hexy</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">content</span>).<span class="ruby-identifier">to_s</span>
674
- 83: <span class="ruby-keyword kw">end</span>
675
- 84: <span class="ruby-keyword kw">end</span>
676
- 85: <span class="ruby-keyword kw">end</span></pre>
677
- </div>
678
-
679
- </div>
680
-
681
-
682
-
683
-
684
- </div>
685
-
686
-
687
- <div id="verify-method" class="method-detail ">
688
- <a name="method-i-verify"></a>
689
-
690
- <div class="method-heading">
691
-
692
- <span class="method-name">verify</span><span
693
- class="method-args">(args)</span>
694
- <span class="method-click-advice">click to toggle source</span>
695
-
696
- </div>
697
-
698
- <div class="method-description">
699
-
700
-
701
-
702
-
703
-
704
- <div class="method-source-code"
705
- id="verify-source">
706
- <pre>
707
- <span class="ruby-comment cmt"># File lib/mu/command/curl.rb, line 30</span>
708
- 30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verify</span> <span class="ruby-identifier">args</span>
709
- 31: <span class="ruby-keyword kw">begin</span>
710
- 32: <span class="ruby-identifier">job</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Curl</span><span class="ruby-operator">::</span><span class="ruby-constant">Verify</span>.<span class="ruby-identifier">execute</span> <span class="ruby-identifier">args</span>
711
- 33: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">job</span>.<span class="ruby-identifier">result</span>
712
- 34: <span class="ruby-identifier">print_verify_result</span> <span class="ruby-identifier">args</span>, <span class="ruby-identifier">result</span>
713
- 35: <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Curl</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">Authorize</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
714
- 36: <span class="ruby-identifier">authorize_error</span> <span class="ruby-identifier">e</span>
715
- 37: <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Curl</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">Region</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
716
- 38: <span class="ruby-identifier">error</span> <span class="ruby-node">&quot;#{e.region}: #{e.message}&quot;</span>
717
- 39: <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Curl</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
718
- 40: <span class="ruby-identifier">error</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
719
- 41: <span class="ruby-keyword kw">end</span>
720
- 42: <span class="ruby-keyword kw">end</span></pre>
721
- </div>
722
-
723
- </div>
724
-
725
-
726
-
727
-
728
- </div>
729
-
730
-
731
- </div>
732
-
733
-
734
- </div>
735
-
736
-
737
- <div id="rdoc-debugging-section-dump" class="debugging-section">
738
-
739
- <p>Disabled; run with --debug to generate this.</p>
740
-
741
- </div>
742
-
743
- <div id="validator-badges">
744
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
745
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
746
- Rdoc Generator</a> 1.1.6</small>.</p>
747
- </div>
748
-
749
- </body>
750
- </html>
751
-