nestful 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.markdown +4 -0
- data/VERSION +1 -1
- data/lib/nestful/formats/multipart_format.rb +4 -2
- data/lib/nestful/resource.rb +3 -1
- data/nestful.gemspec +2 -2
- metadata +3 -3
data/README.markdown
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
@@ -20,7 +20,7 @@ module Nestful
|
|
20
20
|
|
21
21
|
def encode(params, options = nil, namespace = nil)
|
22
22
|
to_multipart(params)
|
23
|
-
stream.write(
|
23
|
+
stream.write("--" + boundary + "--" + EOL)
|
24
24
|
stream.flush
|
25
25
|
stream.rewind
|
26
26
|
stream
|
@@ -52,19 +52,21 @@ module Nestful
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def create_file_field(key, value)
|
55
|
-
stream.write(%Q{Content-Disposition:
|
55
|
+
stream.write(%Q{Content-Disposition: form-data; name="#{key}"; filename="#{filename(value)}"} + EOL)
|
56
56
|
stream.write(%Q{Content-Type: application/octet-stream} + EOL)
|
57
57
|
stream.write(%Q{Content-Transfer-Encoding: binary} + EOL)
|
58
58
|
stream.write(EOL)
|
59
59
|
while data = value.read(8124)
|
60
60
|
stream.write(data)
|
61
61
|
end
|
62
|
+
stream.write(EOL)
|
62
63
|
end
|
63
64
|
|
64
65
|
def create_field(key, value)
|
65
66
|
stream.write(%Q{Content-Disposition: form-data; name="#{key}"} + EOL)
|
66
67
|
stream.write(EOL)
|
67
68
|
stream.write(value)
|
69
|
+
stream.write(EOL)
|
68
70
|
end
|
69
71
|
|
70
72
|
def filename(body)
|
data/lib/nestful/resource.rb
CHANGED
data/nestful.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{nestful}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alex MacCaw"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-05-23}
|
13
13
|
s.description = %q{Simple Ruby HTTP/REST client with a sane API}
|
14
14
|
s.email = %q{info@eribium.org}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alex MacCaw
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-23 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|