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,372 @@
|
|
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: RestClient::Payload::Multipart</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">RestClient::Payload::Multipart</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/payload_rb.html">
|
59
|
+
lib/rest-client-1.6.3/lib/restclient/payload.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
|
+
<a href="Base.html">
|
69
|
+
Base
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000291">boundary</a>
|
92
|
+
<a href="#M000287">build_stream</a>
|
93
|
+
<a href="#M000294">close</a>
|
94
|
+
<a href="#M000289">create_file_field</a>
|
95
|
+
<a href="#M000288">create_regular_field</a>
|
96
|
+
<a href="#M000292">handle_key</a>
|
97
|
+
<a href="#M000293">headers</a>
|
98
|
+
<a href="#M000290">mime_for</a>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
<!-- if includes -->
|
106
|
+
|
107
|
+
<div id="section">
|
108
|
+
|
109
|
+
|
110
|
+
<div id="constants-list">
|
111
|
+
<h3 class="section-bar">Constants</h3>
|
112
|
+
|
113
|
+
<div class="name-list">
|
114
|
+
<table summary="Constants">
|
115
|
+
<tr class="top-aligned-row context-row">
|
116
|
+
<td class="context-item-name">EOL</td>
|
117
|
+
<td>=</td>
|
118
|
+
<td class="context-item-value">"\r\n"</td>
|
119
|
+
</tr>
|
120
|
+
</table>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<!-- if method_list -->
|
130
|
+
<div id="methods">
|
131
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
132
|
+
|
133
|
+
<div id="method-M000291" class="method-detail">
|
134
|
+
<a name="M000291"></a>
|
135
|
+
|
136
|
+
<div class="method-heading">
|
137
|
+
<a href="#M000291" class="method-signature">
|
138
|
+
<span class="method-name">boundary</span><span class="method-args">()</span>
|
139
|
+
</a>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
<p><a class="source-toggle" href="#"
|
144
|
+
onclick="toggleCode('M000291-source');return false;">[Source]</a></p>
|
145
|
+
<div class="method-source-code" id="M000291-source">
|
146
|
+
<pre>
|
147
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 202</span>
|
148
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">boundary</span>
|
149
|
+
<span class="ruby-ivar">@boundary</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">rand</span>(<span class="ruby-value">1_000_000</span>).<span class="ruby-identifier">to_s</span>
|
150
|
+
<span class="ruby-keyword kw">end</span>
|
151
|
+
</pre>
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div id="method-M000287" class="method-detail">
|
157
|
+
<a name="M000287"></a>
|
158
|
+
|
159
|
+
<div class="method-heading">
|
160
|
+
<a href="#M000287" class="method-signature">
|
161
|
+
<span class="method-name">build_stream</span><span class="method-args">(params)</span>
|
162
|
+
</a>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="method-description">
|
166
|
+
<p><a class="source-toggle" href="#"
|
167
|
+
onclick="toggleCode('M000287-source');return false;">[Source]</a></p>
|
168
|
+
<div class="method-source-code" id="M000287-source">
|
169
|
+
<pre>
|
170
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 146</span>
|
171
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_stream</span>(<span class="ruby-identifier">params</span>)
|
172
|
+
<span class="ruby-identifier">b</span> = <span class="ruby-node">"--#{boundary}"</span>
|
173
|
+
|
174
|
+
<span class="ruby-ivar">@stream</span> = <span class="ruby-constant">Tempfile</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"RESTClient.Stream.#{rand(1000)}"</span>)
|
175
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">binmode</span>
|
176
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">b</span> <span class="ruby-operator">+</span> <span class="ruby-constant">EOL</span>)
|
177
|
+
|
178
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Hash</span>
|
179
|
+
<span class="ruby-identifier">x</span> = <span class="ruby-identifier">flatten_params</span>(<span class="ruby-identifier">params</span>)
|
180
|
+
<span class="ruby-keyword kw">else</span>
|
181
|
+
<span class="ruby-identifier">x</span> = <span class="ruby-identifier">params</span>
|
182
|
+
<span class="ruby-keyword kw">end</span>
|
183
|
+
|
184
|
+
<span class="ruby-identifier">last_index</span> = <span class="ruby-identifier">x</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
185
|
+
<span class="ruby-identifier">x</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
|
186
|
+
<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span> = <span class="ruby-operator">*</span> <span class="ruby-identifier">a</span>
|
187
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:read</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:path</span>)
|
188
|
+
<span class="ruby-identifier">create_file_field</span>(<span class="ruby-ivar">@stream</span>, <span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)
|
189
|
+
<span class="ruby-keyword kw">else</span>
|
190
|
+
<span class="ruby-identifier">create_regular_field</span>(<span class="ruby-ivar">@stream</span>, <span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)
|
191
|
+
<span class="ruby-keyword kw">end</span>
|
192
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">EOL</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">b</span>)
|
193
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">EOL</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">last_index</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">index</span>
|
194
|
+
<span class="ruby-keyword kw">end</span>
|
195
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'--'</span>)
|
196
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">EOL</span>)
|
197
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">seek</span>(<span class="ruby-value">0</span>)
|
198
|
+
<span class="ruby-keyword kw">end</span>
|
199
|
+
</pre>
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
<div id="method-M000294" class="method-detail">
|
205
|
+
<a name="M000294"></a>
|
206
|
+
|
207
|
+
<div class="method-heading">
|
208
|
+
<a href="#M000294" class="method-signature">
|
209
|
+
<span class="method-name">close</span><span class="method-args">()</span>
|
210
|
+
</a>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
<div class="method-description">
|
214
|
+
<p><a class="source-toggle" href="#"
|
215
|
+
onclick="toggleCode('M000294-source');return false;">[Source]</a></p>
|
216
|
+
<div class="method-source-code" id="M000294-source">
|
217
|
+
<pre>
|
218
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 215</span>
|
219
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
220
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">close!</span>
|
221
|
+
<span class="ruby-keyword kw">end</span>
|
222
|
+
</pre>
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
|
227
|
+
<div id="method-M000289" class="method-detail">
|
228
|
+
<a name="M000289"></a>
|
229
|
+
|
230
|
+
<div class="method-heading">
|
231
|
+
<a href="#M000289" class="method-signature">
|
232
|
+
<span class="method-name">create_file_field</span><span class="method-args">(s, k, v)</span>
|
233
|
+
</a>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
<p><a class="source-toggle" href="#"
|
238
|
+
onclick="toggleCode('M000289-source');return false;">[Source]</a></p>
|
239
|
+
<div class="method-source-code" id="M000289-source">
|
240
|
+
<pre>
|
241
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 182</span>
|
242
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_file_field</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)
|
243
|
+
<span class="ruby-keyword kw">begin</span>
|
244
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"Content-Disposition: form-data;"</span>)
|
245
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">" name=\"#{k}\";"</span>) <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">k</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">k</span><span class="ruby-operator">==</span><span class="ruby-value str">''</span>)
|
246
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">" filename=\"#{v.respond_to?(:original_filename) ? v.original_filename : File.basename(v.path)}\"#{EOL}"</span>)
|
247
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">"Content-Type: #{v.respond_to?(:content_type) ? v.content_type : mime_for(v.path)}#{EOL}"</span>)
|
248
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">EOL</span>)
|
249
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">data</span> = <span class="ruby-identifier">v</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value">8124</span>)
|
250
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
|
251
|
+
<span class="ruby-keyword kw">end</span>
|
252
|
+
<span class="ruby-keyword kw">ensure</span>
|
253
|
+
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:close</span>)
|
254
|
+
<span class="ruby-keyword kw">end</span>
|
255
|
+
<span class="ruby-keyword kw">end</span>
|
256
|
+
</pre>
|
257
|
+
</div>
|
258
|
+
</div>
|
259
|
+
</div>
|
260
|
+
|
261
|
+
<div id="method-M000288" class="method-detail">
|
262
|
+
<a name="M000288"></a>
|
263
|
+
|
264
|
+
<div class="method-heading">
|
265
|
+
<a href="#M000288" class="method-signature">
|
266
|
+
<span class="method-name">create_regular_field</span><span class="method-args">(s, k, v)</span>
|
267
|
+
</a>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
<div class="method-description">
|
271
|
+
<p><a class="source-toggle" href="#"
|
272
|
+
onclick="toggleCode('M000288-source');return false;">[Source]</a></p>
|
273
|
+
<div class="method-source-code" id="M000288-source">
|
274
|
+
<pre>
|
275
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 175</span>
|
276
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_regular_field</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)
|
277
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">"Content-Disposition: form-data; name=\"#{k}\""</span>)
|
278
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">EOL</span>)
|
279
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">EOL</span>)
|
280
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">v</span>)
|
281
|
+
<span class="ruby-keyword kw">end</span>
|
282
|
+
</pre>
|
283
|
+
</div>
|
284
|
+
</div>
|
285
|
+
</div>
|
286
|
+
|
287
|
+
<div id="method-M000292" class="method-detail">
|
288
|
+
<a name="M000292"></a>
|
289
|
+
|
290
|
+
<div class="method-heading">
|
291
|
+
<a href="#M000292" class="method-signature">
|
292
|
+
<span class="method-name">handle_key</span><span class="method-args">(key)</span>
|
293
|
+
</a>
|
294
|
+
</div>
|
295
|
+
|
296
|
+
<div class="method-description">
|
297
|
+
<p>
|
298
|
+
for <a href="Multipart.html">Multipart</a> do not escape the keys
|
299
|
+
</p>
|
300
|
+
<p><a class="source-toggle" href="#"
|
301
|
+
onclick="toggleCode('M000292-source');return false;">[Source]</a></p>
|
302
|
+
<div class="method-source-code" id="M000292-source">
|
303
|
+
<pre>
|
304
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 207</span>
|
305
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_key</span> <span class="ruby-identifier">key</span>
|
306
|
+
<span class="ruby-identifier">key</span>
|
307
|
+
<span class="ruby-keyword kw">end</span>
|
308
|
+
</pre>
|
309
|
+
</div>
|
310
|
+
</div>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
<div id="method-M000293" class="method-detail">
|
314
|
+
<a name="M000293"></a>
|
315
|
+
|
316
|
+
<div class="method-heading">
|
317
|
+
<a href="#M000293" class="method-signature">
|
318
|
+
<span class="method-name">headers</span><span class="method-args">()</span>
|
319
|
+
</a>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
<div class="method-description">
|
323
|
+
<p><a class="source-toggle" href="#"
|
324
|
+
onclick="toggleCode('M000293-source');return false;">[Source]</a></p>
|
325
|
+
<div class="method-source-code" id="M000293-source">
|
326
|
+
<pre>
|
327
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 211</span>
|
328
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">headers</span>
|
329
|
+
<span class="ruby-keyword kw">super</span>.<span class="ruby-identifier">merge</span>({<span class="ruby-value str">'Content-Type'</span> =<span class="ruby-operator">></span> <span class="ruby-node">%Q{multipart/form-data; boundary=#{boundary}}</span>})
|
330
|
+
<span class="ruby-keyword kw">end</span>
|
331
|
+
</pre>
|
332
|
+
</div>
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
|
336
|
+
<div id="method-M000290" class="method-detail">
|
337
|
+
<a name="M000290"></a>
|
338
|
+
|
339
|
+
<div class="method-heading">
|
340
|
+
<a href="#M000290" class="method-signature">
|
341
|
+
<span class="method-name">mime_for</span><span class="method-args">(path)</span>
|
342
|
+
</a>
|
343
|
+
</div>
|
344
|
+
|
345
|
+
<div class="method-description">
|
346
|
+
<p><a class="source-toggle" href="#"
|
347
|
+
onclick="toggleCode('M000290-source');return false;">[Source]</a></p>
|
348
|
+
<div class="method-source-code" id="M000290-source">
|
349
|
+
<pre>
|
350
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 197</span>
|
351
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mime_for</span>(<span class="ruby-identifier">path</span>)
|
352
|
+
<span class="ruby-identifier">mime</span> = <span class="ruby-constant">MIME</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span>.<span class="ruby-identifier">type_for</span> <span class="ruby-identifier">path</span>
|
353
|
+
<span class="ruby-identifier">mime</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-value str">'text/plain'</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">mime</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">content_type</span>
|
354
|
+
<span class="ruby-keyword kw">end</span>
|
355
|
+
</pre>
|
356
|
+
</div>
|
357
|
+
</div>
|
358
|
+
</div>
|
359
|
+
|
360
|
+
|
361
|
+
</div>
|
362
|
+
|
363
|
+
|
364
|
+
</div>
|
365
|
+
|
366
|
+
|
367
|
+
<div id="validator-badges">
|
368
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
369
|
+
</div>
|
370
|
+
|
371
|
+
</body>
|
372
|
+
</html>
|
@@ -0,0 +1,191 @@
|
|
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: RestClient::Payload::Streamed</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">RestClient::Payload::Streamed</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/payload_rb.html">
|
59
|
+
lib/rest-client-1.6.3/lib/restclient/payload.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
|
+
<a href="Base.html">
|
69
|
+
Base
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000284">build_stream</a>
|
92
|
+
<a href="#M000286">length</a>
|
93
|
+
<a href="#M000285">size</a>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<!-- if includes -->
|
101
|
+
|
102
|
+
<div id="section">
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<!-- if method_list -->
|
112
|
+
<div id="methods">
|
113
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
114
|
+
|
115
|
+
<div id="method-M000284" class="method-detail">
|
116
|
+
<a name="M000284"></a>
|
117
|
+
|
118
|
+
<div class="method-heading">
|
119
|
+
<a href="#M000284" class="method-signature">
|
120
|
+
<span class="method-name">build_stream</span><span class="method-args">(params = nil)</span>
|
121
|
+
</a>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div class="method-description">
|
125
|
+
<p><a class="source-toggle" href="#"
|
126
|
+
onclick="toggleCode('M000284-source');return false;">[Source]</a></p>
|
127
|
+
<div class="method-source-code" id="M000284-source">
|
128
|
+
<pre>
|
129
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 110</span>
|
130
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_stream</span>(<span class="ruby-identifier">params</span> = <span class="ruby-keyword kw">nil</span>)
|
131
|
+
<span class="ruby-ivar">@stream</span> = <span class="ruby-identifier">params</span>
|
132
|
+
<span class="ruby-keyword kw">end</span>
|
133
|
+
</pre>
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div id="method-M000286" class="method-detail">
|
139
|
+
<a name="M000286"></a>
|
140
|
+
|
141
|
+
<div class="method-heading">
|
142
|
+
<span class="method-name">length</span><span class="method-args">()</span>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="method-description">
|
146
|
+
<p>
|
147
|
+
Alias for <a href="Streamed.html#M000285">size</a>
|
148
|
+
</p>
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div id="method-M000285" class="method-detail">
|
153
|
+
<a name="M000285"></a>
|
154
|
+
|
155
|
+
<div class="method-heading">
|
156
|
+
<a href="#M000285" class="method-signature">
|
157
|
+
<span class="method-name">size</span><span class="method-args">()</span>
|
158
|
+
</a>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<div class="method-description">
|
162
|
+
<p><a class="source-toggle" href="#"
|
163
|
+
onclick="toggleCode('M000285-source');return false;">[Source]</a></p>
|
164
|
+
<div class="method-source-code" id="M000285-source">
|
165
|
+
<pre>
|
166
|
+
<span class="ruby-comment cmt"># File lib/rest-client-1.6.3/lib/restclient/payload.rb, line 114</span>
|
167
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">size</span>
|
168
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:size</span>)
|
169
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">size</span>
|
170
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">IO</span>)
|
171
|
+
<span class="ruby-ivar">@stream</span>.<span class="ruby-identifier">stat</span>.<span class="ruby-identifier">size</span>
|
172
|
+
<span class="ruby-keyword kw">end</span>
|
173
|
+
<span class="ruby-keyword kw">end</span>
|
174
|
+
</pre>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
<div id="validator-badges">
|
187
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
</body>
|
191
|
+
</html>
|