tc4r 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/monkey_patch/nestful_decode.rb +27 -0
- data/lib/tc4r.rb +2 -1
- data/lib/tc4r/client.rb +1 -0
- data/lib/tc4r/version.rb +1 -1
- metadata +3 -2
data/README.md
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
module Nestful
|
2
|
+
class Request
|
3
|
+
attr_reader :buffer_binmode
|
4
|
+
|
5
|
+
def decoded(result)
|
6
|
+
if buffer
|
7
|
+
data = Tempfile.new("nfr.#{rand(1000)}")
|
8
|
+
data.binmode if buffer_binmode
|
9
|
+
size = 0
|
10
|
+
total = result.content_length
|
11
|
+
|
12
|
+
result.read_body do |chunk|
|
13
|
+
callback(:progress, self, total, size += chunk.size)
|
14
|
+
data.write(chunk)
|
15
|
+
end
|
16
|
+
|
17
|
+
data.rewind
|
18
|
+
data
|
19
|
+
else
|
20
|
+
return result if raw
|
21
|
+
data = result.body
|
22
|
+
format ? format.decode(data) : data
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
data/lib/tc4r.rb
CHANGED
data/lib/tc4r/client.rb
CHANGED
data/lib/tc4r/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tc4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir:
|
11
11
|
- bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-10-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: commander
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- Rakefile
|
157
157
|
- bin/tc
|
158
158
|
- bin/tc-setup
|
159
|
+
- lib/monkey_patch/nestful_decode.rb
|
159
160
|
- lib/tc4r.rb
|
160
161
|
- lib/tc4r/build.rb
|
161
162
|
- lib/tc4r/build_type.rb
|