wrest 0.0.7-java → 0.0.8-java

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.
@@ -1,7 +1,16 @@
1
+ # Copyright 2009 Sidu Ponnappa
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ # Unless required by applicable law or agreed to in writing, software distributed under the License
7
+ # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8
+ # See the License for the specific language governing permissions and limitations under the License.
9
+
1
10
  require File.dirname(__FILE__) + '/../spec_helper'
2
11
 
3
12
  module Wrest
4
- describe Uri do
13
+ describe Wrest::Uri do
5
14
  def build_ok_response(body = '')
6
15
  returning mock(Net::HTTPOK) do |response|
7
16
  response.stub!(:code).and_return('200')
@@ -26,20 +35,76 @@ module Wrest
26
35
  Uri.new('http://localhost:3000').should_not be_https
27
36
  end
28
37
 
29
- it "should understand equality" do
30
- Uri.new('https://localhost:3000/ooga').should_not == 'https://localhost:3000/ooga'
31
- Uri.new('https://localhost:3000/ooga').should_not == Uri.new('https://localhost:3000/booga')
32
- Uri.new('https://localhost:3000').should_not == Uri.new('https://localhost:3500')
33
- Uri.new('https://localhost:3000').should_not == Uri.new('http://localhost:3000')
34
- Uri.new('http://localhost:3000').should == Uri.new('http://localhost:3000')
38
+ it "should know how to build a new uri from an existing one by appending a path" do
39
+ Uri.new('http://localhost:3000')['/ooga/booga'].should == Uri.new('http://localhost:3000/ooga/booga')
40
+ end
41
+
42
+ it "should know its full path" do
43
+ Uri.new('http://localhost:3000/ooga').full_path.should == '/ooga'
44
+ Uri.new('http://localhost:3000/ooga?foo=meh&bar=1').full_path.should == '/ooga?foo=meh&bar=1'
45
+ end
46
+
47
+ it "should know its host" do
48
+ Uri.new('http://localhost:3000/ooga').host.should == 'localhost'
49
+ end
50
+
51
+ it "should know its port" do
52
+ Uri.new('http://localhost:3000/ooga').port.should == 3000
53
+ Uri.new('http://localhost/ooga').port.should == 80
54
+ end
55
+
56
+ it "should include the username and password while building a new uri if no options are provided" do
57
+ Uri.new(
58
+ 'http://localhost:3000',
59
+ :username => 'foo',
60
+ :password => 'bar')['/ooga/booga'].should == Uri.new(
61
+ 'http://localhost:3000/ooga/booga',
62
+ :username => 'foo',
63
+ :password => 'bar')
35
64
  end
65
+
66
+ it "should use the username and password provided while building a new uri if present" do
67
+ uri = Uri.new('http://localhost:3000', :username => 'foo', :password => 'bar')
68
+ uri.username.should == 'foo'
69
+ uri.password.should == 'bar'
70
+
71
+ extended_uri = uri['/ooga/booga', {:username => 'meh', :password => 'baz'}]
72
+ extended_uri.username.should == 'meh'
73
+ extended_uri.password.should == 'baz'
74
+ end
75
+
76
+ describe 'Equals' do
77
+ it "should understand equality" do
78
+ Uri.new('https://localhost:3000/ooga').should_not == nil
79
+ Uri.new('https://localhost:3000/ooga').should_not == 'https://localhost:3000/ooga'
80
+ Uri.new('https://localhost:3000/ooga').should_not == Uri.new('https://localhost:3000/booga')
81
+
82
+ Uri.new('https://ooga:booga@localhost:3000/ooga').should_not == Uri.new('https://foo:bar@localhost:3000/booga')
83
+ Uri.new('http://ooga:booga@localhost:3000/ooga').should_not == Uri.new('http://foo:bar@localhost:3000/booga')
84
+ Uri.new('http://localhost:3000/ooga').should_not == Uri.new('http://foo:bar@localhost:3000/booga')
85
+
86
+ Uri.new('https://localhost:3000').should_not == Uri.new('https://localhost:3500')
87
+ Uri.new('https://localhost:3000').should_not == Uri.new('http://localhost:3000')
88
+ Uri.new('http://localhost:3000', :username => 'ooga', :password => 'booga').should_not == Uri.new('http://ooga:booga@localhost:3000')
89
+
90
+ Uri.new('http://localhost:3000').should == Uri.new('http://localhost:3000')
91
+ Uri.new('http://localhost:3000', :username => 'ooga', :password => 'booga').should == Uri.new('http://localhost:3000', :username => 'ooga', :password => 'booga')
92
+ Uri.new('http://ooga:booga@localhost:3000').should == Uri.new('http://ooga:booga@localhost:3000')
93
+ end
36
94
 
37
95
 
38
- it "should have the same hash code if it is the same uri" do
39
- Uri.new('https://localhost:3000').hash.should == Uri.new('https://localhost:3000').hash
40
- Uri.new('https://localhost:3001').hash.should_not == Uri.new('https://localhost:3000').hash
96
+ it "should have the same hash code if it is the same uri" do
97
+ Uri.new('https://localhost:3000').hash.should == Uri.new('https://localhost:3000').hash
98
+ Uri.new('http://ooga:booga@localhost:3000').hash.should == Uri.new('http://ooga:booga@localhost:3000').hash
99
+ Uri.new('http://localhost:3000', :username => 'ooga', :password => 'booga').hash.should == Uri.new('http://localhost:3000', :username => 'ooga', :password => 'booga').hash
100
+
101
+ Uri.new('https://localhost:3001').hash.should_not == Uri.new('https://localhost:3000').hash
102
+ Uri.new('https://ooga:booga@localhost:3000').hash.should_not == Uri.new('https://localhost:3000').hash
103
+ Uri.new('https://localhost:3000', :username => 'ooga', :password => 'booga').hash.should_not == Uri.new('https://localhost:3000').hash
104
+ Uri.new('https://localhost:3000', :username => 'ooga', :password => 'booga').hash.should_not == Uri.new('http://localhost:3000', :username => 'foo', :password => 'bar').hash
105
+ end
41
106
  end
42
-
107
+
43
108
  describe 'Get' do
44
109
  it "should know how to get" do
45
110
  uri = "http://localhost:3000/glassware".to_uri
@@ -48,7 +113,10 @@ module Wrest
48
113
  http = mock(Net::HTTP)
49
114
  Net::HTTP.should_receive(:new).with('localhost', 3000).and_return(http)
50
115
 
51
- http.should_receive(:get).with('/glassware', {}).and_return(build_ok_response)
116
+ request = Net::HTTP::Get.new('/glassware', {})
117
+ Net::HTTP::Get.should_receive(:new).with('/glassware', {}).and_return(request)
118
+
119
+ http.should_receive(:request).with(request, nil).and_return(build_ok_response)
52
120
 
53
121
  uri.get
54
122
  end
@@ -59,8 +127,11 @@ module Wrest
59
127
 
60
128
  http = mock(Net::HTTP)
61
129
  Net::HTTP.should_receive(:new).with('localhost', 3000).and_return(http)
62
-
63
- http.should_receive(:get).with('/glassware?owner=Kai&type=bottle', 'page' => '2', 'per_page' => '5').and_return(build_ok_response)
130
+
131
+ request = Net::HTTP::Get.new('/glassware?owner=Kai&type=bottle', {'page' => '2', 'per_page' => '5'})
132
+ Net::HTTP::Get.should_receive(:new).with('/glassware?owner=Kai&type=bottle', {'page' => '2', 'per_page' => '5'}).and_return(request)
133
+
134
+ http.should_receive(:request).with(request, nil).and_return(build_ok_response)
64
135
 
65
136
  uri.get({:owner => 'Kai', :type => 'bottle'}, :page => '2', :per_page => '5')
66
137
  end
@@ -72,7 +143,10 @@ module Wrest
72
143
  http = mock(Net::HTTP)
73
144
  Net::HTTP.should_receive(:new).with('localhost', 3000).and_return(http)
74
145
 
75
- http.should_receive(:get).with('/glassware?owner=Kai&type=bottle', {}).and_return(build_ok_response)
146
+ request = Net::HTTP::Get.new('/glassware?owner=Kai&type=bottle', {})
147
+ Net::HTTP::Get.should_receive(:new).with('/glassware?owner=Kai&type=bottle', {}).and_return(request)
148
+
149
+ http.should_receive(:request).with(request, nil).and_return(build_ok_response)
76
150
 
77
151
  uri.get(:owner => 'Kai', :type => 'bottle')
78
152
  end
@@ -85,7 +159,10 @@ module Wrest
85
159
  http = mock(Net::HTTP)
86
160
  Net::HTTP.should_receive(:new).with('localhost', 3000).and_return(http)
87
161
 
88
- http.should_receive(:post).with('/glassware', '<ooga>Booga</ooga>', {'page' => '2', 'per_page' => '5'}).and_return(build_ok_response)
162
+ request = Net::HTTP::Post.new('/glassware', {'page' => '2', 'per_page' => '5'})
163
+ Net::HTTP::Post.should_receive(:new).with('/glassware', {'page' => '2', 'per_page' => '5'}).and_return(request)
164
+
165
+ http.should_receive(:request).with(request, '<ooga>Booga</ooga>').and_return(build_ok_response)
89
166
 
90
167
  uri.post '<ooga>Booga</ooga>', :page => '2', :per_page => '5'
91
168
  end
@@ -96,8 +173,11 @@ module Wrest
96
173
 
97
174
  http = mock(Net::HTTP)
98
175
  Net::HTTP.should_receive(:new).with('localhost', 3000).and_return(http)
176
+
177
+ request = Net::HTTP::Put.new('/glassware', {'page' => '2', 'per_page' => '5'})
178
+ Net::HTTP::Put.should_receive(:new).with('/glassware', {'page' => '2', 'per_page' => '5'}).and_return(request)
99
179
 
100
- http.should_receive(:put).with('/glassware', '<ooga>Booga</ooga>', {'page' => '2', 'per_page' => '5'}).and_return(build_ok_response)
180
+ http.should_receive(:request).with(request, '<ooga>Booga</ooga>').and_return(build_ok_response)
101
181
 
102
182
  uri.put '<ooga>Booga</ooga>', :page => '2', :per_page => '5'
103
183
  end
@@ -109,7 +189,10 @@ module Wrest
109
189
  http = mock(Net::HTTP)
110
190
  Net::HTTP.should_receive(:new).with('localhost', 3000).and_return(http)
111
191
 
112
- http.should_receive(:delete).with('/glassware?owner=Kai&type=bottle', {'page' => '2', 'per_page' => '5'}).and_return(build_ok_response(nil))
192
+ request = Net::HTTP::Delete.new('/glassware?owner=Kai&type=bottle', {'page' => '2', 'per_page' => '5'})
193
+ Net::HTTP::Delete.should_receive(:new).with('/glassware?owner=Kai&type=bottle', {'page' => '2', 'per_page' => '5'}).and_return(request)
194
+
195
+ http.should_receive(:request).with(request, nil).and_return(build_ok_response(nil))
113
196
 
114
197
  uri.delete({:owner => 'Kai', :type => 'bottle'}, :page => '2', :per_page => '5')
115
198
  end
@@ -121,7 +204,10 @@ module Wrest
121
204
  http = mock(Net::HTTP)
122
205
  Net::HTTP.should_receive(:new).with('localhost', 3000).and_return(http)
123
206
 
124
- http.should_receive(:options).with('/glassware').and_return(build_ok_response(nil))
207
+ request = Net::HTTP::Options.new('/glassware')
208
+ Net::HTTP::Options.should_receive(:new).with('/glassware', {}).and_return(request)
209
+
210
+ http.should_receive(:request).with(request, nil).and_return(build_ok_response(nil))
125
211
 
126
212
  uri.options
127
213
  end
@@ -133,8 +219,14 @@ module Wrest
133
219
  http = mock(Net::HTTP)
134
220
  Net::HTTP.should_receive(:new).with('localhost', 3000).any_number_of_times.and_return(http)
135
221
 
136
- http.should_receive(:get).with('/glassware?owner=Kai&type=bottle', 'page' => '2', 'per_page' => '5').and_return(build_ok_response)
137
- http.should_receive(:post).with('/glassware', '<ooga>Booga</ooga>', {'page' => '2', 'per_page' => '5'}).and_return(build_ok_response)
222
+ request_get = Net::HTTP::Get.new('/glassware?owner=Kai&type=bottle', {'page' => '2', 'per_page' => '5'})
223
+ Net::HTTP::Get.should_receive(:new).with('/glassware?owner=Kai&type=bottle', {'page' => '2', 'per_page' => '5'}).and_return(request_get)
224
+
225
+ request_post = Net::HTTP::Post.new('/glassware', {'page' => '2', 'per_page' => '5'})
226
+ Net::HTTP::Post.should_receive(:new).with('/glassware', {'page' => '2', 'per_page' => '5'}).and_return(request_post)
227
+
228
+ http.should_receive(:request).with(request_get, nil).and_return(build_ok_response)
229
+ http.should_receive(:request).with(request_post, '<ooga>Booga</ooga>').and_return(build_ok_response)
138
230
 
139
231
  uri.get({:owner => 'Kai', :type => 'bottle'}, :page => '2', :per_page => '5')
140
232
  uri.post '<ooga>Booga</ooga>', :page => '2', :per_page => '5'
@@ -10,7 +10,7 @@
10
10
  require File.dirname(__FILE__) + '/../spec_helper'
11
11
 
12
12
  module Wrest
13
- describe UriTemplate do
13
+ describe Wrest::UriTemplate do
14
14
  it "should not maintain a reference to the string it is initialized with" do
15
15
  url_pattern = "http://localhost:3000/:resource/:id.:format"
16
16
  template = UriTemplate.new(url_pattern)
@@ -24,5 +24,15 @@ module Wrest
24
24
  :resource => 'shen_coins', :id => 5, :format => :json
25
25
  ).should == "http://localhost:3000/shen_coins/5.json".to_uri
26
26
  end
27
+
28
+ it "should also handle username and password" do
29
+ template = UriTemplate.new("http://:user::password@coathangers.com/:resource/:id")
30
+ template.to_uri(
31
+ :user => 'kaiwren',
32
+ :password => 'fupuppies',
33
+ :resource => 'portal',
34
+ :id => '1'
35
+ ).should == "http://kaiwren:fupuppies@coathangers.com/portal/1".to_uri
36
+ end
27
37
  end
28
38
  end
metadata CHANGED
@@ -1,143 +1,156 @@
1
1
  --- !ruby/object:Gem::Specification
2
+ name: wrest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.8
5
+ platform: java
6
+ authors:
7
+ - Sidu Ponnappa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-13 00:00:00 +05:30
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.3.2
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: json-jruby
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.3
34
+ version:
35
+ description: Wrest is a REST client library which allows you to quickly build object oriented wrappers around any web service. It has two main components - Wrest Core and Wrest::Resource.
36
+ email: ckponnappa@gmail.com
37
+ executables:
38
+ - wrest
39
+ - jwrest
2
40
  extensions: []
3
41
 
42
+ extra_rdoc_files:
43
+ - README.rdoc
44
+ files:
45
+ - README.rdoc
46
+ - Rakefile
47
+ - VERSION.yml
48
+ - bin/jwrest
49
+ - bin/wrest
50
+ - bin/wrest_shell.rb
51
+ - examples/delicious.rb
52
+ - examples/wow_realm_status.rb
53
+ - lib/wrest.rb
54
+ - lib/wrest/components.rb
55
+ - lib/wrest/components/attributes_container.rb
56
+ - lib/wrest/components/attributes_container/typecaster.rb
57
+ - lib/wrest/components/mutators.rb
58
+ - lib/wrest/components/mutators/base.rb
59
+ - lib/wrest/components/mutators/camel_to_snake_case.rb
60
+ - lib/wrest/components/mutators/xml_mini_type_caster.rb
61
+ - lib/wrest/components/mutators/xml_simple_type_caster.rb
62
+ - lib/wrest/components/translators.rb
63
+ - lib/wrest/components/translators/content_types.rb
64
+ - lib/wrest/components/translators/json.rb
65
+ - lib/wrest/components/translators/xml.rb
66
+ - lib/wrest/core_ext/hash.rb
67
+ - lib/wrest/core_ext/hash/conversions.rb
68
+ - lib/wrest/core_ext/string.rb
69
+ - lib/wrest/core_ext/string/conversions.rb
70
+ - lib/wrest/exceptions.rb
71
+ - lib/wrest/exceptions/method_not_overridden_exception.rb
72
+ - lib/wrest/exceptions/unsupported_content_type_exception.rb
73
+ - lib/wrest/http.rb
74
+ - lib/wrest/http/delete.rb
75
+ - lib/wrest/http/get.rb
76
+ - lib/wrest/http/options.rb
77
+ - lib/wrest/http/post.rb
78
+ - lib/wrest/http/put.rb
79
+ - lib/wrest/http/request.rb
80
+ - lib/wrest/http/response.rb
81
+ - lib/wrest/resource.rb
82
+ - lib/wrest/resource/base.rb
83
+ - lib/wrest/resource/collection.rb
84
+ - lib/wrest/resource/state.rb
85
+ - lib/wrest/uri.rb
86
+ - lib/wrest/uri_template.rb
87
+ - lib/wrest/version.rb
88
+ - spec/custom_matchers/custom_matchers.rb
89
+ - spec/rcov.opts
90
+ - spec/spec.opts
91
+ - spec/spec_helper.rb
92
+ - spec/wrest/components/attributes_container/typecaster_spec.rb
93
+ - spec/wrest/components/attributes_container_spec.rb
94
+ - spec/wrest/components/mutators/base_spec.rb
95
+ - spec/wrest/components/mutators/camel_to_snake_spec.rb
96
+ - spec/wrest/components/mutators/xml_mini_type_caster_spec.rb
97
+ - spec/wrest/components/mutators/xml_simple_type_caster_spec.rb
98
+ - spec/wrest/components/mutators_spec.rb
99
+ - spec/wrest/components/translators/xml_spec.rb
100
+ - spec/wrest/components/translators_spec.rb
101
+ - spec/wrest/core_ext/hash/conversions_spec.rb
102
+ - spec/wrest/core_ext/string/conversions_spec.rb
103
+ - spec/wrest/http/request_spec.rb
104
+ - spec/wrest/http/response_spec.rb
105
+ - spec/wrest/resource/base_spec.rb
106
+ - spec/wrest/uri_spec.rb
107
+ - spec/wrest/uri_template_spec.rb
108
+ has_rdoc: true
4
109
  homepage: http://github.com/kaiwren/wrest
5
- executables:
6
- - wrest
7
- - jwrest
8
- version: !ruby/object:Gem::Version
9
- version: 0.0.7
110
+ licenses: []
111
+
10
112
  post_install_message:
11
- date: 2009-05-06 18:30:00 +00:00
12
- files:
13
- - README.rdoc
14
- - Rakefile
15
- - VERSION.yml
16
- - bin/jwrest
17
- - bin/wrest
18
- - bin/wrest_shell.rb
19
- - lib/wrest.rb
20
- - lib/wrest/components.rb
21
- - lib/wrest/components/attributes_container.rb
22
- - lib/wrest/components/attributes_container/typecaster.rb
23
- - lib/wrest/components/mutators.rb
24
- - lib/wrest/components/mutators/base.rb
25
- - lib/wrest/components/mutators/camel_to_snake_case.rb
26
- - lib/wrest/components/mutators/xml_mini_type_caster.rb
27
- - lib/wrest/components/mutators/xml_simple_type_caster.rb
28
- - lib/wrest/components/translators.rb
29
- - lib/wrest/components/translators/content_types.rb
30
- - lib/wrest/components/translators/json.rb
31
- - lib/wrest/components/translators/xml.rb
32
- - lib/wrest/core_ext/hash.rb
33
- - lib/wrest/core_ext/hash/conversions.rb
34
- - lib/wrest/core_ext/string.rb
35
- - lib/wrest/core_ext/string/conversions.rb
36
- - lib/wrest/exceptions.rb
37
- - lib/wrest/exceptions/method_not_overridden_exception.rb
38
- - lib/wrest/exceptions/unsupported_content_type_exception.rb
39
- - lib/wrest/resource.rb
40
- - lib/wrest/resource/base.rb
41
- - lib/wrest/resource/collection.rb
42
- - lib/wrest/resource/state.rb
43
- - lib/wrest/response.rb
44
- - lib/wrest/uri.rb
45
- - lib/wrest/uri_template.rb
46
- - lib/wrest/version.rb
47
- - spec/custom_matchers/custom_matchers.rb
48
- - spec/rcov.opts
49
- - spec/spec.opts
50
- - spec/spec_helper.rb
51
- - spec/wrest/components/attributes_container/typecaster_spec.rb
52
- - spec/wrest/components/attributes_container_spec.rb
53
- - spec/wrest/components/mutators/base_spec.rb
54
- - spec/wrest/components/mutators/camel_to_snake_spec.rb
55
- - spec/wrest/components/mutators/xml_mini_type_caster_spec.rb
56
- - spec/wrest/components/mutators/xml_simple_type_caster_spec.rb
57
- - spec/wrest/components/mutators_spec.rb
58
- - spec/wrest/components/translators/xml_spec.rb
59
- - spec/wrest/components/translators_spec.rb
60
- - spec/wrest/core_ext/hash/conversions_spec.rb
61
- - spec/wrest/core_ext/string/conversions_spec.rb
62
- - spec/wrest/resource/base_spec.rb
63
- - spec/wrest/response_spec.rb
64
- - spec/wrest/uri_spec.rb
65
- - spec/wrest/uri_template_spec.rb
66
- rubygems_version: 1.3.1
67
113
  rdoc_options:
68
- - --charset=UTF-8
69
- signing_key:
70
- cert_chain: []
71
-
72
- name: wrest
73
- has_rdoc: true
74
- platform: java
75
- summary: REST client library for Ruby.
76
- default_executable:
77
- bindir: bin
78
- required_rubygems_version: !ruby/object:Gem::Requirement
79
- version:
80
- requirements:
81
- - - '>='
82
- - !ruby/object:Gem::Version
83
- version: "0"
114
+ - --charset=UTF-8
115
+ require_paths:
116
+ - lib
84
117
  required_ruby_version: !ruby/object:Gem::Requirement
85
- version:
86
118
  requirements:
87
- - - '>='
88
- - !ruby/object:Gem::Version
89
- version: "0"
90
- require_paths:
91
- - lib
92
- specification_version: 2
93
- test_files:
94
- - spec/spec_helper.rb
95
- - spec/custom_matchers/custom_matchers.rb
96
- - spec/wrest/response_spec.rb
97
- - spec/wrest/uri_spec.rb
98
- - spec/wrest/uri_template_spec.rb
99
- - spec/wrest/components/attributes_container_spec.rb
100
- - spec/wrest/components/mutators_spec.rb
101
- - spec/wrest/components/translators_spec.rb
102
- - spec/wrest/components/attributes_container/typecaster_spec.rb
103
- - spec/wrest/components/mutators/base_spec.rb
104
- - spec/wrest/components/mutators/camel_to_snake_spec.rb
105
- - spec/wrest/components/mutators/xml_mini_type_caster_spec.rb
106
- - spec/wrest/components/mutators/xml_simple_type_caster_spec.rb
107
- - spec/wrest/components/translators/xml_spec.rb
108
- - spec/wrest/core_ext/hash/conversions_spec.rb
109
- - spec/wrest/core_ext/string/conversions_spec.rb
110
- - spec/wrest/resource/base_spec.rb
111
- dependencies:
112
- - !ruby/object:Gem::Dependency
113
- type: :runtime
114
- name: activesupport
115
- version_requirement:
116
- version_requirements: !ruby/object:Gem::Requirement
117
- version:
118
- requirements:
119
- - - '>='
119
+ - - ">="
120
120
  - !ruby/object:Gem::Version
121
- version: 2.3.2
122
- - !ruby/object:Gem::Dependency
123
- type: :runtime
124
- name: json-jruby
125
- version_requirement:
126
- version_requirements: !ruby/object:Gem::Requirement
127
- version:
128
- requirements:
129
- - - '>='
121
+ version: "0"
122
+ version:
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
130
126
  - !ruby/object:Gem::Version
131
- version: 1.1.3
132
- description: Wrest is a REST client library which allows you to quickly build object
133
- oriented wrappers around any web service. It has two main components - Wrest Core
134
- and Wrest::Resource.
135
- email: ckponnappa@gmail.com
136
- authors:
137
- - Sidu Ponnappa
138
- extra_rdoc_files:
139
- - README.rdoc
127
+ version: "0"
128
+ version:
140
129
  requirements: []
141
130
 
142
131
  rubyforge_project: wrest
143
- autorequire:
132
+ rubygems_version: 1.3.4
133
+ signing_key:
134
+ specification_version: 3
135
+ summary: REST client library for Ruby.
136
+ test_files:
137
+ - spec/spec_helper.rb
138
+ - spec/custom_matchers/custom_matchers.rb
139
+ - spec/wrest/uri_spec.rb
140
+ - spec/wrest/uri_template_spec.rb
141
+ - spec/wrest/components/attributes_container_spec.rb
142
+ - spec/wrest/components/mutators_spec.rb
143
+ - spec/wrest/components/translators_spec.rb
144
+ - spec/wrest/components/attributes_container/typecaster_spec.rb
145
+ - spec/wrest/components/mutators/base_spec.rb
146
+ - spec/wrest/components/mutators/camel_to_snake_spec.rb
147
+ - spec/wrest/components/mutators/xml_mini_type_caster_spec.rb
148
+ - spec/wrest/components/mutators/xml_simple_type_caster_spec.rb
149
+ - spec/wrest/components/translators/xml_spec.rb
150
+ - spec/wrest/core_ext/hash/conversions_spec.rb
151
+ - spec/wrest/core_ext/string/conversions_spec.rb
152
+ - spec/wrest/http/request_spec.rb
153
+ - spec/wrest/http/response_spec.rb
154
+ - spec/wrest/resource/base_spec.rb
155
+ - examples/delicious.rb
156
+ - examples/wow_realm_status.rb
@@ -1,42 +0,0 @@
1
- # Copyright 2009 Sidu Ponnappa
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- # Unless required by applicable law or agreed to in writing, software distributed under the License
7
- # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8
- # See the License for the specific language governing permissions and limitations under the License.
9
-
10
- module Wrest #:nodoc:
11
- # Decorates a response providing support for deserialisation.
12
- #
13
- # The following methods are also available (unlisted by rdoc because they're forwarded):
14
- #
15
- # <tt>:@http_response, :code, :message, :body, :http_version,
16
- # :[], :content_length, :content_type, :each_header, :each_name, :each_value, :fetch,
17
- # :get_fields, :key?, :type_params</tt>
18
- #
19
- # They behave exactly like their Net::HTTPResponse equivalents.
20
- class Response
21
- extend Forwardable
22
- def_delegators :@http_response, :code, :message, :body, :http_version,
23
- :[], :content_length, :content_type, :each_header, :each_name, :each_value, :fetch,
24
- :get_fields, :key?, :type_params
25
-
26
- def initialize(http_response)
27
- @http_response = http_response
28
- end
29
-
30
- def deserialise
31
- deserialise_using(Wrest::Components::Translators.lookup(@http_response.content_type))
32
- end
33
-
34
- def deserialise_using(translator)
35
- translator.deserialise(@http_response)
36
- end
37
-
38
- def headers
39
- @http_response.to_hash
40
- end
41
- end
42
- end