api-client 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -32,7 +32,7 @@ You can define a more generic rescue that will work for any error:
32
32
 
33
33
  On Your model, extend ApiClient::Base
34
34
 
35
- def User < Apiclient::Base
35
+ class User < ApiClient::Base
36
36
 
37
37
  Then, on your action, just put into it:
38
38
 
@@ -7,7 +7,7 @@ module ApiClient::Dispatcher
7
7
 
8
8
  def _post(url = '', args = {})
9
9
  uri = URI(url)
10
- http = Net::HTTP.new(uri.host)
10
+ http = Net::HTTP.new(uri.host, uri.port)
11
11
  http.post(uri.path, args.to_json, { 'Content-Type' => 'application/json' })
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module ApiClient
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -80,9 +80,20 @@ describe ApiClient::Base do
80
80
  User.stub(:new).and_return(user)
81
81
  end
82
82
 
83
- it "should return a object intialized with the response" do
83
+ it "should return a object initialized with the response" do
84
84
  User.post('http://api.example.com/user/5', {}).should == user
85
85
  end
86
86
  end
87
+
88
+ context "with a specified port" do
89
+ before :each do
90
+ FakeWeb.register_uri(:post, "http://api.example.com:3001/user/5", :status => "201", :body => '{"a": "a", "b": "b"}')
91
+ User.stub(:new).and_return(user)
92
+ end
93
+
94
+ it "should return a object initialized with the response" do
95
+ User.post('http://api.example.com:3001/user/5', {}).should == user
96
+ end
97
+ end
87
98
  end
88
99
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -138,18 +138,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
138
  - - ! '>='
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
- segments:
142
- - 0
143
- hash: -2592261694451152331
144
141
  required_rubygems_version: !ruby/object:Gem::Requirement
145
142
  none: false
146
143
  requirements:
147
144
  - - ! '>='
148
145
  - !ruby/object:Gem::Version
149
146
  version: '0'
150
- segments:
151
- - 0
152
- hash: -2592261694451152331
153
147
  requirements: []
154
148
  rubyforge_project:
155
149
  rubygems_version: 1.8.24