nestful 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  Nestful is a simple Ruby HTTP/REST client with a sane API.
2
2
 
3
+ ## Installation
4
+
5
+ sudo gem install nestful
6
+
3
7
  ## Features
4
8
 
5
9
  * Simple API
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
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(EOL + "--" + boundary + "--" + EOL)
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: format-data; name="#{key}"; filename="#{filename(value)}"} + EOL)
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)
@@ -8,7 +8,9 @@ module Nestful
8
8
  end
9
9
 
10
10
  def [](suburl)
11
- self.class.new(URI.join(url, suburl).to_s)
11
+ base = url
12
+ base += "/" unless base =~ /\/$/
13
+ self.class.new(URI.join(base, suburl).to_s)
12
14
  end
13
15
 
14
16
  def get(options = {})
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{nestful}
8
- s.version = "0.0.1"
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-04-21}
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
- - 1
9
- version: 0.0.1
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-04-21 00:00:00 +01:00
17
+ date: 2010-05-23 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency