cft_smartcloud 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -0
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/bin/cft_smartcloud +37 -0
- data/cft_smartcloud.gemspec +88 -7
- data/lib/smartcloud.rb +12 -2
- data/lib/smartcloud_logger.rb +1 -1
- data/rdoc/classes/ConfigTable/BoolItem.html +172 -0
- data/rdoc/classes/ConfigTable/ExecItem.html +252 -0
- data/rdoc/classes/ConfigTable/Item.html +308 -0
- data/rdoc/classes/ConfigTable/MetaConfigEnvironment.html +445 -0
- data/rdoc/classes/ConfigTable/PackageSelectionItem.html +188 -0
- data/rdoc/classes/ConfigTable/PathItem.html +148 -0
- data/rdoc/classes/ConfigTable/ProgramItem.html +148 -0
- data/rdoc/classes/ConfigTable/SelectItem.html +175 -0
- data/rdoc/classes/ConfigTable.html +724 -0
- data/rdoc/classes/Enumerable.html +157 -0
- data/rdoc/classes/Errno/ENOTEMPTY.html +111 -0
- data/rdoc/classes/Errno.html +111 -0
- data/rdoc/classes/File.html +197 -0
- data/rdoc/classes/FileOperations.html +600 -0
- data/rdoc/classes/Hash.html +163 -0
- data/rdoc/classes/HookScriptAPI.html +413 -0
- data/rdoc/classes/IBMSmartCloud.html +1484 -0
- data/rdoc/classes/Installer/Shebang.html +245 -0
- data/rdoc/classes/Installer.html +1660 -0
- data/rdoc/classes/MIME/InvalidContentType.html +119 -0
- data/rdoc/classes/MIME/Type.html +1366 -0
- data/rdoc/classes/MIME/Types.html +643 -0
- data/rdoc/classes/MIME.html +124 -0
- data/rdoc/classes/MockSmartCloud.html +376 -0
- data/rdoc/classes/Net/HTTP.html +164 -0
- data/rdoc/classes/Net.html +122 -0
- data/rdoc/classes/RestClient/AbstractResponse.html +417 -0
- data/rdoc/classes/RestClient/Exception.html +305 -0
- data/rdoc/classes/RestClient/ExceptionWithResponse.html +119 -0
- data/rdoc/classes/RestClient/Exceptions.html +130 -0
- data/rdoc/classes/RestClient/MaxRedirectsReached.html +113 -0
- data/rdoc/classes/RestClient/Payload/Base.html +422 -0
- data/rdoc/classes/RestClient/Payload/Multipart.html +372 -0
- data/rdoc/classes/RestClient/Payload/Streamed.html +191 -0
- data/rdoc/classes/RestClient/Payload/UrlEncoded.html +202 -0
- data/rdoc/classes/RestClient/Payload.html +192 -0
- data/rdoc/classes/RestClient/RawResponse.html +236 -0
- data/rdoc/classes/RestClient/Redirect.html +168 -0
- data/rdoc/classes/RestClient/Request.html +950 -0
- data/rdoc/classes/RestClient/RequestFailed.html +178 -0
- data/rdoc/classes/RestClient/Resource.html +607 -0
- data/rdoc/classes/RestClient/Response.html +208 -0
- data/rdoc/classes/RestClient/ResponseForException.html +152 -0
- data/rdoc/classes/RestClient/SSLCertificateNotVerified.html +149 -0
- data/rdoc/classes/RestClient/ServerBrokeConnection.html +157 -0
- data/rdoc/classes/RestClient.html +737 -0
- data/rdoc/classes/SetupError.html +111 -0
- data/rdoc/classes/SmartcloudLogger.html +162 -0
- data/rdoc/classes/TestMIME.html +109 -0
- data/rdoc/classes/ToplevelInstaller.html +987 -0
- data/rdoc/classes/ToplevelInstallerMulti.html +593 -0
- data/rdoc/classes/XmlSimple/Cache.html +372 -0
- data/rdoc/classes/XmlSimple.html +475 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_rdoc.html +198 -0
- data/rdoc/files/lib/hash_fix_rb.html +115 -0
- data/rdoc/files/lib/mime-types-1_16/lib/mime/types_rb.html +107 -0
- data/rdoc/files/lib/mime-types-1_16/setup_rb.html +157 -0
- data/rdoc/files/lib/mime-types-1_16/test/test_mime_type_rb.html +109 -0
- data/rdoc/files/lib/mime-types-1_16/test/test_mime_types_rb.html +109 -0
- data/rdoc/files/lib/mock_smartcloud_rb.html +115 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/rest-client_rb.html +107 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/rest_client_rb.html +108 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient/abstract_response_rb.html +108 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient/exceptions_rb.html +101 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient/net_http_ext_rb.html +113 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient/payload_rb.html +110 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient/raw_response_rb.html +101 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient/request_rb.html +110 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient/resource_rb.html +101 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient/response_rb.html +101 -0
- data/rdoc/files/lib/rest-client-1_6_3/lib/restclient_rb.html +111 -0
- data/rdoc/files/lib/restclient_fix_rb.html +115 -0
- data/rdoc/files/lib/smartcloud_logger_rb.html +115 -0
- data/rdoc/files/lib/smartcloud_rb.html +143 -0
- data/rdoc/files/lib/xml-simple-1_0_12/lib/xmlsimple_rb.html +124 -0
- data/rdoc/fr_class_index.html +79 -0
- data/rdoc/fr_file_index.html +48 -0
- data/rdoc/fr_method_index.html +441 -0
- data/rdoc/index.html +26 -0
- data/rdoc/rdoc-style.css +208 -0
- metadata +90 -6
@@ -0,0 +1,417 @@
|
|
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>Module: RestClient::AbstractResponse</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">RestClient::AbstractResponse</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/rest-client-1_6_3/lib/restclient/abstract_response_rb.html">
|
59
|
+
lib/rest-client-1.6.3/lib/restclient/abstract_response.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000315">beautify_headers</a>
|
84
|
+
<a href="#M000307">code</a>
|
85
|
+
<a href="#M000310">cookies</a>
|
86
|
+
<a href="#M000313">description</a>
|
87
|
+
<a href="#M000314">follow_redirection</a>
|
88
|
+
<a href="#M000308">headers</a>
|
89
|
+
<a href="#M000309">raw_headers</a>
|
90
|
+
<a href="#M000311">return!</a>
|
91
|
+
<a href="#M000312">to_i</a>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
|
98
|
+
<!-- if includes -->
|
99
|
+
|
100
|
+
<div id="section">
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<div id="attribute-list">
|
107
|
+
<h3 class="section-bar">Attributes</h3>
|
108
|
+
|
109
|
+
<div class="name-list">
|
110
|
+
<table>
|
111
|
+
<tr class="top-aligned-row context-row">
|
112
|
+
<td class="context-item-name">args</td>
|
113
|
+
<td class="context-item-value"> [R] </td>
|
114
|
+
<td class="context-item-desc"></td>
|
115
|
+
</tr>
|
116
|
+
<tr class="top-aligned-row context-row">
|
117
|
+
<td class="context-item-name">net_http_res</td>
|
118
|
+
<td class="context-item-value"> [R] </td>
|
119
|
+
<td class="context-item-desc"></td>
|
120
|
+
</tr>
|
121
|
+
</table>
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
<!-- if method_list -->
|
128
|
+
<div id="methods">
|
129
|
+
<h3 class="section-bar">Public Class methods</h3>
|
130
|
+
|
131
|
+
<div id="method-M000315" class="method-detail">
|
132
|
+
<a name="M000315"></a>
|
133
|
+
|
134
|
+
<div class="method-heading">
|
135
|
+
<a href="#M000315" class="method-signature">
|
136
|
+
<span class="method-name">beautify_headers</span><span class="method-args">(headers)</span>
|
137
|
+
</a>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div class="method-description">
|
141
|
+
<p><a class="source-toggle" href="#"
|
142
|
+
onclick="toggleCode('M000315-source');return false;">[Source]</a></p>
|
143
|
+
<div class="method-source-code" id="M000315-source">
|
144
|
+
<pre>
|
145
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 85</span>
|
146
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">AbstractResponse</span>.<span class="ruby-identifier">beautify_headers</span>(<span class="ruby-identifier">headers</span>)
|
147
|
+
<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">out</span>, (<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)<span class="ruby-operator">|</span>
|
148
|
+
<span class="ruby-identifier">out</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/-/</span>, <span class="ruby-value str">'_'</span>).<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-node">%w{ set-cookie }</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">first</span>
|
149
|
+
<span class="ruby-identifier">out</span>
|
150
|
+
<span class="ruby-keyword kw">end</span>
|
151
|
+
<span class="ruby-keyword kw">end</span>
|
152
|
+
</pre>
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
158
|
+
|
159
|
+
<div id="method-M000307" class="method-detail">
|
160
|
+
<a name="M000307"></a>
|
161
|
+
|
162
|
+
<div class="method-heading">
|
163
|
+
<a href="#M000307" class="method-signature">
|
164
|
+
<span class="method-name">code</span><span class="method-args">()</span>
|
165
|
+
</a>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div class="method-description">
|
169
|
+
<p>
|
170
|
+
HTTP status <a href="AbstractResponse.html#M000307">code</a>
|
171
|
+
</p>
|
172
|
+
<p><a class="source-toggle" href="#"
|
173
|
+
onclick="toggleCode('M000307-source');return false;">[Source]</a></p>
|
174
|
+
<div class="method-source-code" id="M000307-source">
|
175
|
+
<pre>
|
176
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 10</span>
|
177
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">code</span>
|
178
|
+
<span class="ruby-ivar">@code</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@net_http_res</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">to_i</span>
|
179
|
+
<span class="ruby-keyword kw">end</span>
|
180
|
+
</pre>
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
<div id="method-M000310" class="method-detail">
|
186
|
+
<a name="M000310"></a>
|
187
|
+
|
188
|
+
<div class="method-heading">
|
189
|
+
<a href="#M000310" class="method-signature">
|
190
|
+
<span class="method-name">cookies</span><span class="method-args">()</span>
|
191
|
+
</a>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
<div class="method-description">
|
195
|
+
<p>
|
196
|
+
<a href="../Hash.html">Hash</a> of <a
|
197
|
+
href="AbstractResponse.html#M000310">cookies</a> extracted from response <a
|
198
|
+
href="AbstractResponse.html#M000308">headers</a>
|
199
|
+
</p>
|
200
|
+
<p><a class="source-toggle" href="#"
|
201
|
+
onclick="toggleCode('M000310-source');return false;">[Source]</a></p>
|
202
|
+
<div class="method-source-code" id="M000310-source">
|
203
|
+
<pre>
|
204
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 26</span>
|
205
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cookies</span>
|
206
|
+
<span class="ruby-ivar">@cookies</span> <span class="ruby-operator">||=</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-identifier">:set_cookie</span>] <span class="ruby-operator">||</span> {}).<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">out</span>, <span class="ruby-identifier">cookie_content</span><span class="ruby-operator">|</span>
|
207
|
+
<span class="ruby-identifier">out</span>.<span class="ruby-identifier">merge</span> <span class="ruby-identifier">parse_cookie</span>(<span class="ruby-identifier">cookie_content</span>)
|
208
|
+
<span class="ruby-keyword kw">end</span>
|
209
|
+
<span class="ruby-keyword kw">end</span>
|
210
|
+
</pre>
|
211
|
+
</div>
|
212
|
+
</div>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<div id="method-M000313" class="method-detail">
|
216
|
+
<a name="M000313"></a>
|
217
|
+
|
218
|
+
<div class="method-heading">
|
219
|
+
<a href="#M000313" class="method-signature">
|
220
|
+
<span class="method-name">description</span><span class="method-args">()</span>
|
221
|
+
</a>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
<div class="method-description">
|
225
|
+
<p><a class="source-toggle" href="#"
|
226
|
+
onclick="toggleCode('M000313-source');return false;">[Source]</a></p>
|
227
|
+
<div class="method-source-code" id="M000313-source">
|
228
|
+
<pre>
|
229
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 58</span>
|
230
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">description</span>
|
231
|
+
<span class="ruby-node">"#{code} #{STATUSES[code]} | #{(headers[:content_type] || '').gsub(/;.*$/, '')} #{size} bytes\n"</span>
|
232
|
+
<span class="ruby-keyword kw">end</span>
|
233
|
+
</pre>
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div id="method-M000314" class="method-detail">
|
239
|
+
<a name="M000314"></a>
|
240
|
+
|
241
|
+
<div class="method-heading">
|
242
|
+
<a href="#M000314" class="method-signature">
|
243
|
+
<span class="method-name">follow_redirection</span><span class="method-args">(request = nil, result = nil, & block)</span>
|
244
|
+
</a>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
<div class="method-description">
|
248
|
+
<p>
|
249
|
+
Follow a redirection
|
250
|
+
</p>
|
251
|
+
<p><a class="source-toggle" href="#"
|
252
|
+
onclick="toggleCode('M000314-source');return false;">[Source]</a></p>
|
253
|
+
<div class="method-source-code" id="M000314-source">
|
254
|
+
<pre>
|
255
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 63</span>
|
256
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">follow_redirection</span> <span class="ruby-identifier">request</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span> <span class="ruby-identifier">block</span>
|
257
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-identifier">headers</span>[<span class="ruby-identifier">:location</span>]
|
258
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/^http/</span>
|
259
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:url</span>]).<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">url</span>).<span class="ruby-identifier">to_s</span>
|
260
|
+
<span class="ruby-keyword kw">end</span>
|
261
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:url</span>] = <span class="ruby-identifier">url</span>
|
262
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>
|
263
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">max_redirects</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
264
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">MaxRedirectsReached</span>
|
265
|
+
<span class="ruby-keyword kw">end</span>
|
266
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:password</span>] = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">password</span>
|
267
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:user</span>] = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">user</span>
|
268
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:headers</span>] = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">headers</span>
|
269
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:max_redirects</span>] = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">max_redirects</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
270
|
+
<span class="ruby-comment cmt"># pass any cookie set in the result</span>
|
271
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'set-cookie'</span>]
|
272
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:headers</span>][<span class="ruby-identifier">:cookies</span>] = (<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:headers</span>][<span class="ruby-identifier">:cookies</span>] <span class="ruby-operator">||</span> {}).<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">parse_cookie</span>(<span class="ruby-identifier">result</span>[<span class="ruby-value str">'set-cookie'</span>]))
|
273
|
+
<span class="ruby-keyword kw">end</span>
|
274
|
+
<span class="ruby-keyword kw">end</span>
|
275
|
+
<span class="ruby-constant">Request</span>.<span class="ruby-identifier">execute</span> <span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>
|
276
|
+
<span class="ruby-keyword kw">end</span>
|
277
|
+
</pre>
|
278
|
+
</div>
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
<div id="method-M000308" class="method-detail">
|
283
|
+
<a name="M000308"></a>
|
284
|
+
|
285
|
+
<div class="method-heading">
|
286
|
+
<a href="#M000308" class="method-signature">
|
287
|
+
<span class="method-name">headers</span><span class="method-args">()</span>
|
288
|
+
</a>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
<div class="method-description">
|
292
|
+
<p>
|
293
|
+
A hash of the <a href="AbstractResponse.html#M000308">headers</a>,
|
294
|
+
beautified with symbols and underscores. e.g. "Content-type" will
|
295
|
+
become :content_type.
|
296
|
+
</p>
|
297
|
+
<p><a class="source-toggle" href="#"
|
298
|
+
onclick="toggleCode('M000308-source');return false;">[Source]</a></p>
|
299
|
+
<div class="method-source-code" id="M000308-source">
|
300
|
+
<pre>
|
301
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 16</span>
|
302
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">headers</span>
|
303
|
+
<span class="ruby-ivar">@headers</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">AbstractResponse</span>.<span class="ruby-identifier">beautify_headers</span>(<span class="ruby-ivar">@net_http_res</span>.<span class="ruby-identifier">to_hash</span>)
|
304
|
+
<span class="ruby-keyword kw">end</span>
|
305
|
+
</pre>
|
306
|
+
</div>
|
307
|
+
</div>
|
308
|
+
</div>
|
309
|
+
|
310
|
+
<div id="method-M000309" class="method-detail">
|
311
|
+
<a name="M000309"></a>
|
312
|
+
|
313
|
+
<div class="method-heading">
|
314
|
+
<a href="#M000309" class="method-signature">
|
315
|
+
<span class="method-name">raw_headers</span><span class="method-args">()</span>
|
316
|
+
</a>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
<div class="method-description">
|
320
|
+
<p>
|
321
|
+
The raw <a href="AbstractResponse.html#M000308">headers</a>.
|
322
|
+
</p>
|
323
|
+
<p><a class="source-toggle" href="#"
|
324
|
+
onclick="toggleCode('M000309-source');return false;">[Source]</a></p>
|
325
|
+
<div class="method-source-code" id="M000309-source">
|
326
|
+
<pre>
|
327
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 21</span>
|
328
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raw_headers</span>
|
329
|
+
<span class="ruby-ivar">@raw_headers</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@net_http_res</span>.<span class="ruby-identifier">to_hash</span>
|
330
|
+
<span class="ruby-keyword kw">end</span>
|
331
|
+
</pre>
|
332
|
+
</div>
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
|
336
|
+
<div id="method-M000311" class="method-detail">
|
337
|
+
<a name="M000311"></a>
|
338
|
+
|
339
|
+
<div class="method-heading">
|
340
|
+
<a href="#M000311" class="method-signature">
|
341
|
+
<span class="method-name">return!</span><span class="method-args">(request = nil, result = nil, & block)</span>
|
342
|
+
</a>
|
343
|
+
</div>
|
344
|
+
|
345
|
+
<div class="method-description">
|
346
|
+
<p>
|
347
|
+
Return the default behavior corresponding to the response <a
|
348
|
+
href="AbstractResponse.html#M000307">code</a>: the response itself for <a
|
349
|
+
href="AbstractResponse.html#M000307">code</a> in 200..206, redirection for
|
350
|
+
301, 302 and 307 in get and head cases, redirection for 303 and an
|
351
|
+
exception in other cases
|
352
|
+
</p>
|
353
|
+
<p><a class="source-toggle" href="#"
|
354
|
+
onclick="toggleCode('M000311-source');return false;">[Source]</a></p>
|
355
|
+
<div class="method-source-code" id="M000311-source">
|
356
|
+
<pre>
|
357
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 34</span>
|
358
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">return!</span> <span class="ruby-identifier">request</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span> <span class="ruby-identifier">block</span>
|
359
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-value">200</span><span class="ruby-operator">..</span><span class="ruby-value">207</span>).<span class="ruby-identifier">include?</span> <span class="ruby-identifier">code</span>
|
360
|
+
<span class="ruby-keyword kw">self</span>
|
361
|
+
<span class="ruby-keyword kw">elsif</span> [<span class="ruby-value">301</span>, <span class="ruby-value">302</span>, <span class="ruby-value">307</span>].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">code</span>
|
362
|
+
<span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:get</span>, <span class="ruby-identifier">:head</span>].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:method</span>]
|
363
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Exceptions</span><span class="ruby-operator">::</span><span class="ruby-constant">EXCEPTIONS_MAP</span>[<span class="ruby-identifier">code</span>].<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">code</span>)
|
364
|
+
<span class="ruby-keyword kw">else</span>
|
365
|
+
<span class="ruby-identifier">follow_redirection</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">result</span>, <span class="ruby-operator">&</span> <span class="ruby-identifier">block</span>)
|
366
|
+
<span class="ruby-keyword kw">end</span>
|
367
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">==</span> <span class="ruby-value">303</span>
|
368
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:method</span>] = <span class="ruby-identifier">:get</span>
|
369
|
+
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">:payload</span>
|
370
|
+
<span class="ruby-identifier">follow_redirection</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">result</span>, <span class="ruby-operator">&</span> <span class="ruby-identifier">block</span>)
|
371
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">Exceptions</span><span class="ruby-operator">::</span><span class="ruby-constant">EXCEPTIONS_MAP</span>[<span class="ruby-identifier">code</span>]
|
372
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Exceptions</span><span class="ruby-operator">::</span><span class="ruby-constant">EXCEPTIONS_MAP</span>[<span class="ruby-identifier">code</span>].<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">code</span>)
|
373
|
+
<span class="ruby-keyword kw">else</span>
|
374
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RequestFailed</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">code</span>)
|
375
|
+
<span class="ruby-keyword kw">end</span>
|
376
|
+
<span class="ruby-keyword kw">end</span>
|
377
|
+
</pre>
|
378
|
+
</div>
|
379
|
+
</div>
|
380
|
+
</div>
|
381
|
+
|
382
|
+
<div id="method-M000312" class="method-detail">
|
383
|
+
<a name="M000312"></a>
|
384
|
+
|
385
|
+
<div class="method-heading">
|
386
|
+
<a href="#M000312" class="method-signature">
|
387
|
+
<span class="method-name">to_i</span><span class="method-args">()</span>
|
388
|
+
</a>
|
389
|
+
</div>
|
390
|
+
|
391
|
+
<div class="method-description">
|
392
|
+
<p><a class="source-toggle" href="#"
|
393
|
+
onclick="toggleCode('M000312-source');return false;">[Source]</a></p>
|
394
|
+
<div class="method-source-code" id="M000312-source">
|
395
|
+
<pre>
|
396
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/abstract_response.rb, line 54</span>
|
397
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_i</span>
|
398
|
+
<span class="ruby-identifier">code</span>
|
399
|
+
<span class="ruby-keyword kw">end</span>
|
400
|
+
</pre>
|
401
|
+
</div>
|
402
|
+
</div>
|
403
|
+
</div>
|
404
|
+
|
405
|
+
|
406
|
+
</div>
|
407
|
+
|
408
|
+
|
409
|
+
</div>
|
410
|
+
|
411
|
+
|
412
|
+
<div id="validator-badges">
|
413
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
414
|
+
</div>
|
415
|
+
|
416
|
+
</body>
|
417
|
+
</html>
|