wrest 1.1.0 → 1.2.0

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/CHANGELOG CHANGED
@@ -2,7 +2,10 @@ Features under the section marked 'Current' are completed but pending release as
2
2
 
3
3
  Features under a numbered section are complete and available in the Wrest gem.
4
4
 
5
- == 1.1
5
+ == 1.2.0
6
+ * GH#80 Add a convenience API to make it easy to use the existing URI callback API
7
+
8
+ == 1.1.0
6
9
  * Caching support introduced. Includes Memcached support for the cache store. (GH# 69, 83, 87)
7
10
 
8
11
  == 1.0.2
@@ -94,14 +94,7 @@ To delete a resource:
94
94
  :url => 'http://c2.com'
95
95
  )
96
96
 
97
-
98
- ==== OPTIONS
99
-
100
- To find out what actions are permitted on a URI:
101
-
102
- 'http://www.yahoo.com'.to_uri.options.headers['allow']
103
-
104
- ==== Caching
97
+ === Caching
105
98
 
106
99
  Wrest supports caching with pluggable back-ends.
107
100
 
@@ -116,6 +109,7 @@ Use the following method to enable caching for all requests, and set Memcached a
116
109
  Wrest.always_cache_using_memcached!
117
110
 
118
111
  For fine-grained control over the cache store (or to use multiple cache stores in the same codebase), you can use this API:
112
+
119
113
  memcache_store = Wrest::Components::CacheStore::Memcached.new("localhost:11211")
120
114
  hash_store = {}
121
115
 
@@ -126,9 +120,15 @@ A detailed writeup regarding caching as defined by RFC 2616, and how Wrest imple
126
120
 
127
121
  You can create your own back-ends for Wrest caching by implementing the interface implemented in https://github.com/kaiwren/wrest/blob/master/lib/wrest/components/cache_store/memcached.rb
128
122
 
123
+ To explicitly disable caching for specific requests:
124
+
125
+ "http://c42.in".to_uri(:disable_cache => true).get
126
+
129
127
  ==== Callbacks
130
128
 
131
- You can define a set of callbacks that are invoked based on the http code of the response.
129
+ ===== Uri level callbacks
130
+
131
+ You can define a set of callbacks that are invoked based on the http codes of the responses to any requests on a given uri.
132
132
 
133
133
  "http://google.com".to_uri(:callback => {
134
134
  200 => lambda {|response| Wrest.logger.info "Ok." },
@@ -136,6 +136,24 @@ You can define a set of callbacks that are invoked based on the http code of the
136
136
  300..302 => lambda {|response| Wrest.logger.debug "Redirected. #{response.message}" }
137
137
  }).get
138
138
 
139
+ ===== Per request callbacks
140
+
141
+ You can also define callbacks that are invoked based on the http code of the response to a particular request.
142
+
143
+ "http://google.com".to_uri.get do |callback|
144
+ callback.on_ok do |response|
145
+ Wrest.logger.info "Ok."
146
+ end
147
+
148
+ callback.on(202) do |response|
149
+ Wrest.logger.info "Accepted."
150
+ end
151
+
152
+ callback.on(200..206) do |response|
153
+ Wrest.logger.info "Successful."
154
+ end
155
+ end
156
+
139
157
  Please note that Wrest is a synchronous library. All requests are blocking, and will not return till the request is completed and appropriate callbacks executed.
140
158
 
141
159
  === Other useful stuff
@@ -215,4 +233,5 @@ Run the tests in a different terminal:
215
233
  * Nikhil Vallishayee : {nikhilvallishayee}[http://github.com/nikhilvallishayee]
216
234
  * Jacques Crocker : {railsjedi}[http://github.com/railsjedi]
217
235
  * Jasim A Basheer: {jasim}[http://github.com/jasim]
236
+ * Arvind Laxminarayan: {ardsrk}[http://github.com/ardsrk]
218
237
 
@@ -97,6 +97,7 @@ require "#{Wrest::Root}/wrest/version"
97
97
  require "#{Wrest::Root}/wrest/cache_proxy"
98
98
  require "#{Wrest::Root}/wrest/http_shared"
99
99
  require "#{Wrest::Root}/wrest/http_codes"
100
+ require "#{Wrest::Root}/wrest/callback"
100
101
  require "#{Wrest::Root}/wrest/native"
101
102
 
102
103
 
@@ -99,10 +99,7 @@ module Wrest
99
99
  cache_validation_headers["if-modified-since"] = last_modified unless last_modified.nil?
100
100
  cache_validation_headers["if-none-match"] = etag unless etag.nil?
101
101
 
102
- new_headers =@get.headers.clone.merge cache_validation_headers
103
- new_options =@get.options.clone.tap { |opts| opts.delete :cache_store } # do not run this through the caching mechanism.
104
-
105
- new_request = Wrest::Native::Get.new(@get.uri, @get.parameters, new_headers, new_options)
102
+ new_request = @get.build_request_without_cache_store(cache_validation_headers)
106
103
 
107
104
  new_request.invoke
108
105
  end
@@ -0,0 +1,65 @@
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 native://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
11
+ class Callback
12
+ attr_reader :callback_hash
13
+
14
+ def initialize(callable)
15
+ if callable.is_a?(Hash)
16
+ @callback_hash = Callback.ensure_values_are_collections(callable)
17
+ elsif callable.is_a?(Proc)
18
+ @callback_hash = {}
19
+ callable.call(self)
20
+ end
21
+ end
22
+
23
+ def merge(callback)
24
+ merged_callback_hash = callback_hash.clone
25
+ other_callback_hash = callback.callback_hash
26
+ other_callback_hash.each do |code, callback_blocks|
27
+ merged_callback_hash[code] ||= []
28
+ merged_callback_hash[code] += callback_blocks
29
+ end
30
+ Callback.new(merged_callback_hash)
31
+ end
32
+
33
+ def execute(response)
34
+ callback_hash.each do |code, callback_list|
35
+ callback_list.each {|callback| callback.call(response)} if case code
36
+ when Range
37
+ code.include?(response.code.to_i)
38
+ when Fixnum
39
+ code == response.code.to_i
40
+ end
41
+ end
42
+ end
43
+
44
+ def on(code, &block)
45
+ @callback_hash[code] ? @callback_hash[code] << block : @callback_hash[code] = [block]
46
+ end
47
+
48
+ {200 => "ok", 201 => "created", 202 => "accepted", 204 => "no_content", 301 => "moved_permanently", 302 => "found", 303 => "see_other", 304 => "not_modified",
49
+ 307 => "temporary_redirect", 400 => "bad_request", 401 => "unauthorized", 403 => "forbidden", 404 => "not_found", 405 => "method_not_allowed",
50
+ 406 => "not_acceptable", 422 => "unprocessable_entity", 500 => "internal_server_error"}.each do |code, method|
51
+ method_name = "on_#{method}".to_sym
52
+ define_method method_name do |&block|
53
+ (@callback_hash[code] ? @callback_hash[code] << block : @callback_hash[code] = [block]) if block
54
+ end
55
+ end
56
+
57
+ def self.ensure_values_are_collections(hash)
58
+ result = {}
59
+ hash.each do |code, block|
60
+ result[code] = block.is_a?(Array) ? block : [block]
61
+ end
62
+ result
63
+ end
64
+ end
65
+ end
@@ -34,14 +34,14 @@ module Wrest
34
34
  # File.open('/path/to/image.jpg') do |file|
35
35
  # 'http://localhost:3000/uploads'.to_uri.post_multipart('file' => UploadIO.new(file, "image/jpg", '/path/to/image.jpg'))
36
36
  # end
37
- def post_multipart(parameters = {}, headers = {})
38
- Http::PostMultipart.new(self, parameters, headers, @options).invoke
37
+ def post_multipart(parameters = {}, headers = {}, &block)
38
+ Http::PostMultipart.new(self, parameters, headers, block ? @options.merge(:callback_block => block) : @options).invoke
39
39
  end
40
40
 
41
41
  # Makes a multipart/form-data encoded PUT request to this URI. This is a convenience API
42
42
  # that mimics a multipart form being put. I sincerely hope you never need to use this.
43
- def put_multipart(parameters = {}, headers = {})
44
- Http::PutMultipart.new(self, parameters, headers, @options).invoke
43
+ def put_multipart(parameters = {}, headers = {}, &block)
44
+ Http::PutMultipart.new(self, parameters, headers, block ? @options.merge(:callback_block => block) : @options).invoke
45
45
  end
46
46
  end
47
47
 
@@ -14,7 +14,10 @@ module Wrest::Native
14
14
  def initialize(wrest_uri, parameters = {}, headers = {}, options = {})
15
15
  follow_redirects = options[:follow_redirects]
16
16
  options[:follow_redirects] = (follow_redirects == nil ? true : follow_redirects)
17
- @cache_proxy = Wrest::CacheProxy::new(self, options[:cache_store] || Wrest.default_cachestore)
17
+
18
+ cache_store = (options[:cache_store] || Wrest.default_cachestore) unless options[:disable_cache]
19
+ @cache_proxy = Wrest::CacheProxy::new(self, cache_store)
20
+
18
21
  super(
19
22
  wrest_uri,
20
23
  Net::HTTP::Get,
@@ -51,5 +54,14 @@ module Wrest::Native
51
54
  end
52
55
 
53
56
  alias_method_chain :invoke, :cache_check
57
+
58
+ def build_request_without_cache_store(cache_validation_headers)
59
+ new_headers = headers.clone.merge cache_validation_headers
60
+ new_options = options.clone.tap { |opts| opts.delete :cache_store; opts[:disable_cache] = true } # do not run this through the caching mechanism.
61
+
62
+ new_request = Wrest::Native::Get.new(uri, parameters, new_headers, new_options)
63
+ new_request
64
+ end
65
+
54
66
  end
55
67
  end
@@ -57,7 +57,8 @@ module Wrest::Native
57
57
  @cache_store = options[:cache_store]
58
58
  @verify_mode = @options[:verify_mode]
59
59
  @detailed_http_logging = options[:detailed_http_logging]
60
- @callback = @options[:callback] || {}
60
+ @uri_callback = Wrest::Callback.new(@options[:callback] || {})
61
+ @request_callback = Wrest::Callback.new(@options[:callback_block] || {})
61
62
  end
62
63
 
63
64
  # Makes a request, runs the appropriate callback if any and
@@ -114,14 +115,7 @@ module Wrest::Native
114
115
 
115
116
  #:nodoc:
116
117
  def execute_callback_if_any(actual_response)
117
- @callback.each do |callback_response_range, callback|
118
- callback.call(actual_response) if case callback_response_range
119
- when Range
120
- callback_response_range.include?(actual_response.code.to_i)
121
- when Fixnum
122
- callback_response_range == actual_response.code.to_i
123
- end
124
- end
118
+ @uri_callback.merge(@request_callback).execute(actual_response)
125
119
  end
126
120
  end
127
121
  end
@@ -91,16 +91,16 @@ module Wrest #:nodoc:
91
91
  # that creates a Wrest::Native::Get, executes it and returns a Wrest::Native::Response.
92
92
  #
93
93
  # Remember to escape all parameter strings if necessary, using URI.escape
94
- def get(parameters = {}, headers = {})
95
- Http::Get.new(self, parameters, headers, @options).invoke
94
+ def get(parameters = {}, headers = {}, &block)
95
+ Http::Get.new(self, parameters, headers, block ? @options.merge(:callback_block => block) : @options).invoke
96
96
  end
97
97
 
98
98
  # Make a PUT request to this URI. This is a convenience API
99
99
  # that creates a Wrest::Native::Put, executes it and returns a Wrest::Native::Response.
100
100
  #
101
101
  # Remember to escape all parameter strings if necessary, using URI.escape
102
- def put(body = '', headers = {}, parameters = {})
103
- Http::Put.new(self, body.to_s, headers, parameters, @options).invoke
102
+ def put(body = '', headers = {}, parameters = {}, &block)
103
+ Http::Put.new(self, body.to_s, headers, parameters, block ? @options.merge(:callback_block => block) : @options).invoke
104
104
  end
105
105
 
106
106
  # Makes a POST request to this URI. This is a convenience API
@@ -108,8 +108,8 @@ module Wrest #:nodoc:
108
108
  # Note that sending an empty body will blow up if you're using libcurl.
109
109
  #
110
110
  # Remember to escape all parameter strings if necessary, using URI.escape
111
- def post(body = '', headers = {}, parameters = {})
112
- Http::Post.new(self, body.to_s, headers, parameters, @options).invoke
111
+ def post(body = '', headers = {}, parameters = {}, &block)
112
+ Http::Post.new(self, body.to_s, headers, parameters, block ? @options.merge(:callback_block => block) : @options).invoke
113
113
  end
114
114
 
115
115
  # Makes a POST request to this URI. This is a convenience API
@@ -119,18 +119,18 @@ module Wrest #:nodoc:
119
119
  # Form encoding involves munging the parameters into a string and placing them
120
120
  # in the body, as well as setting the Content-Type header to
121
121
  # application/x-www-form-urlencoded
122
- def post_form(parameters = {}, headers = {})
122
+ def post_form(parameters = {}, headers = {}, &block)
123
123
  headers = headers.merge(Wrest::H::ContentType => Wrest::T::FormEncoded)
124
124
  body = parameters.to_query
125
- Http::Post.new(self, body, headers, {}, @options).invoke
125
+ Http::Post.new(self, body, headers, {}, block ? @options.merge(:callback_block => block) : @options).invoke
126
126
  end
127
127
 
128
128
  # Makes a DELETE request to this URI. This is a convenience API
129
129
  # that creates a Wrest::Native::Delete, executes it and returns a Wrest::Native::Response.
130
130
  #
131
131
  # Remember to escape all parameter strings if necessary, using URI.escape
132
- def delete(parameters = {}, headers = {})
133
- Http::Delete.new(self, parameters, headers, @options).invoke
132
+ def delete(parameters = {}, headers = {}, &block)
133
+ Http::Delete.new(self, parameters, headers, block ? @options.merge(:callback_block => block) : @options).invoke
134
134
  end
135
135
 
136
136
  # Makes an OPTIONS request to this URI. This is a convenience API
@@ -8,5 +8,5 @@
8
8
  # See the License for the specific language governing permissions and limitations under the License.
9
9
 
10
10
  module Wrest
11
- VERSION = "1.1.0"
11
+ VERSION = "1.2.0"
12
12
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
4
  prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 0
10
- version: 1.1.0
5
+ version: 1.2.0
11
6
  platform: ruby
12
7
  authors:
13
8
  - Sidu Ponnappa
@@ -16,7 +11,7 @@ autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
13
 
19
- date: 2011-01-28 00:00:00 +05:30
14
+ date: 2011-02-03 00:00:00 +05:30
20
15
  default_executable:
21
16
  dependencies:
22
17
  - !ruby/object:Gem::Dependency
@@ -27,9 +22,6 @@ dependencies:
27
22
  requirements:
28
23
  - - ">="
29
24
  - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
25
  version: "0"
34
26
  type: :development
35
27
  version_requirements: *id001
@@ -41,9 +33,6 @@ dependencies:
41
33
  requirements:
42
34
  - - ">="
43
35
  - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
36
  version: "0"
48
37
  type: :development
49
38
  version_requirements: *id002
@@ -55,11 +44,6 @@ dependencies:
55
44
  requirements:
56
45
  - - ~>
57
46
  - !ruby/object:Gem::Version
58
- hash: 31
59
- segments:
60
- - 2
61
- - 4
62
- - 0
63
47
  version: 2.4.0
64
48
  type: :development
65
49
  version_requirements: *id003
@@ -71,11 +55,6 @@ dependencies:
71
55
  requirements:
72
56
  - - ~>
73
57
  - !ruby/object:Gem::Version
74
- hash: 23
75
- segments:
76
- - 1
77
- - 0
78
- - 0
79
58
  version: 1.0.0
80
59
  type: :development
81
60
  version_requirements: *id004
@@ -87,9 +66,6 @@ dependencies:
87
66
  requirements:
88
67
  - - ">="
89
68
  - !ruby/object:Gem::Version
90
- hash: 3
91
- segments:
92
- - 0
93
69
  version: "0"
94
70
  type: :development
95
71
  version_requirements: *id005
@@ -101,11 +77,6 @@ dependencies:
101
77
  requirements:
102
78
  - - ~>
103
79
  - !ruby/object:Gem::Version
104
- hash: 7
105
- segments:
106
- - 3
107
- - 0
108
- - 0
109
80
  version: 3.0.0
110
81
  type: :runtime
111
82
  version_requirements: *id006
@@ -117,11 +88,6 @@ dependencies:
117
88
  requirements:
118
89
  - - ~>
119
90
  - !ruby/object:Gem::Version
120
- hash: 15
121
- segments:
122
- - 2
123
- - 1
124
- - 2
125
91
  version: 2.1.2
126
92
  type: :runtime
127
93
  version_requirements: *id007
@@ -133,11 +99,6 @@ dependencies:
133
99
  requirements:
134
100
  - - ">="
135
101
  - !ruby/object:Gem::Version
136
- hash: 13
137
- segments:
138
- - 0
139
- - 4
140
- - 1
141
102
  version: 0.4.1
142
103
  type: :runtime
143
104
  version_requirements: *id008
@@ -149,11 +110,6 @@ dependencies:
149
110
  requirements:
150
111
  - - ">="
151
112
  - !ruby/object:Gem::Version
152
- hash: 61
153
- segments:
154
- - 0
155
- - 3
156
- - 23
157
113
  version: 0.3.23
158
114
  type: :runtime
159
115
  version_requirements: *id009
@@ -165,11 +121,6 @@ dependencies:
165
121
  requirements:
166
122
  - - ~>
167
123
  - !ruby/object:Gem::Version
168
- hash: 11
169
- segments:
170
- - 1
171
- - 4
172
- - 6
173
124
  version: 1.4.6
174
125
  type: :runtime
175
126
  version_requirements: *id010
@@ -183,77 +134,76 @@ extensions: []
183
134
  extra_rdoc_files:
184
135
  - README.rdoc
185
136
  files:
186
- - bin/wrest.compiled.rbc
187
- - bin/wrest_shell.rb
188
- - bin/wrest_shell.rbc
189
137
  - bin/wrest
190
- - lib/wrest_no_ext.rb
191
- - lib/wrest.rb
192
- - lib/wrest/http_shared.rb
193
- - lib/wrest/components/translators.rb
138
+ - bin/wrest_shell.rb
139
+ - lib/wrest/cache_proxy.rb
140
+ - lib/wrest/callback.rb
194
141
  - lib/wrest/components/cache_store/memcached.rb
142
+ - lib/wrest/components/container/alias_accessors.rb
143
+ - lib/wrest/components/container/typecaster.rb
195
144
  - lib/wrest/components/container.rb
196
- - lib/wrest/components/mutators/xml_mini_type_caster.rb
197
145
  - lib/wrest/components/mutators/base.rb
198
146
  - lib/wrest/components/mutators/camel_to_snake_case.rb
147
+ - lib/wrest/components/mutators/xml_mini_type_caster.rb
199
148
  - lib/wrest/components/mutators/xml_simple_type_caster.rb
200
- - lib/wrest/components/translators/xml.rb
149
+ - lib/wrest/components/mutators.rb
201
150
  - lib/wrest/components/translators/content_types.rb
202
151
  - lib/wrest/components/translators/json.rb
203
- - lib/wrest/components/mutators.rb
204
- - lib/wrest/components/container/typecaster.rb
205
- - lib/wrest/components/container/alias_accessors.rb
206
- - lib/wrest/cache_proxy.rb
207
- - lib/wrest/native/request.rb
208
- - lib/wrest/native/connection_factory.rb
209
- - lib/wrest/native/put_multipart.rb
210
- - lib/wrest/native/delete.rb
211
- - lib/wrest/native/response.rb
212
- - lib/wrest/native/get.rb
213
- - lib/wrest/native/post_multipart.rb
214
- - lib/wrest/native/put.rb
215
- - lib/wrest/native/options.rb
216
- - lib/wrest/native/session.rb
217
- - lib/wrest/native/post.rb
218
- - lib/wrest/native/redirection.rb
219
- - lib/wrest/core_ext/string/conversions.rb
152
+ - lib/wrest/components/translators/xml.rb
153
+ - lib/wrest/components/translators.rb
154
+ - lib/wrest/components.rb
220
155
  - lib/wrest/core_ext/hash/conversions.rb
221
156
  - lib/wrest/core_ext/hash.rb
157
+ - lib/wrest/core_ext/string/conversions.rb
222
158
  - lib/wrest/core_ext/string.rb
223
- - lib/wrest/native.rb
224
- - lib/wrest/curl/request.rb
225
- - lib/wrest/curl/put_multipart.rb
226
159
  - lib/wrest/curl/delete.rb
227
- - lib/wrest/curl/response.rb
228
160
  - lib/wrest/curl/get.rb
161
+ - lib/wrest/curl/options.rb
162
+ - lib/wrest/curl/post.rb
229
163
  - lib/wrest/curl/post_multipart.rb
230
164
  - lib/wrest/curl/put.rb
231
- - lib/wrest/curl/options.rb
165
+ - lib/wrest/curl/put_multipart.rb
166
+ - lib/wrest/curl/request.rb
167
+ - lib/wrest/curl/response.rb
232
168
  - lib/wrest/curl/session.rb
233
- - lib/wrest/curl/post.rb
234
- - lib/wrest/multipart.rb
235
- - lib/wrest/xml_mini.rb
169
+ - lib/wrest/curl.rb
236
170
  - lib/wrest/exceptions.rb
237
171
  - lib/wrest/hash_with_case_insensitive_access.rb
238
- - lib/wrest/curl.rb
172
+ - lib/wrest/http_codes.rb
173
+ - lib/wrest/http_shared/headers.rb
174
+ - lib/wrest/http_shared/standard_headers.rb
175
+ - lib/wrest/http_shared/standard_tokens.rb
176
+ - lib/wrest/http_shared.rb
177
+ - lib/wrest/multipart.rb
178
+ - lib/wrest/native/connection_factory.rb
179
+ - lib/wrest/native/delete.rb
180
+ - lib/wrest/native/get.rb
181
+ - lib/wrest/native/options.rb
182
+ - lib/wrest/native/post.rb
183
+ - lib/wrest/native/post_multipart.rb
184
+ - lib/wrest/native/put.rb
185
+ - lib/wrest/native/put_multipart.rb
186
+ - lib/wrest/native/redirection.rb
187
+ - lib/wrest/native/request.rb
188
+ - lib/wrest/native/response.rb
189
+ - lib/wrest/native/session.rb
190
+ - lib/wrest/native.rb
191
+ - lib/wrest/test/request_patches.rb
239
192
  - lib/wrest/test.rb
193
+ - lib/wrest/uri.rb
240
194
  - lib/wrest/uri_template.rb
241
- - lib/wrest/xml_mini/rexml/xpath_filter.rb
242
- - lib/wrest/xml_mini/libxml.rb
195
+ - lib/wrest/version.rb
196
+ - lib/wrest/xml_mini/jdom/xpath_filter.rb
243
197
  - lib/wrest/xml_mini/jdom.rb
244
- - lib/wrest/xml_mini/nokogiri.rb
245
198
  - lib/wrest/xml_mini/libxml/xpath_filter.rb
246
- - lib/wrest/xml_mini/jdom/xpath_filter.rb
247
- - lib/wrest/xml_mini/rexml.rb
199
+ - lib/wrest/xml_mini/libxml.rb
248
200
  - lib/wrest/xml_mini/nokogiri/xpath_filter.rb
249
- - lib/wrest/uri.rb
250
- - lib/wrest/http_codes.rb
251
- - lib/wrest/test/request_patches.rb
252
- - lib/wrest/http_shared/standard_headers.rb
253
- - lib/wrest/http_shared/standard_tokens.rb
254
- - lib/wrest/http_shared/headers.rb
255
- - lib/wrest/components.rb
256
- - lib/wrest/version.rb
201
+ - lib/wrest/xml_mini/nokogiri.rb
202
+ - lib/wrest/xml_mini/rexml/xpath_filter.rb
203
+ - lib/wrest/xml_mini/rexml.rb
204
+ - lib/wrest/xml_mini.rb
205
+ - lib/wrest.rb
206
+ - lib/wrest_no_ext.rb
257
207
  - README.rdoc
258
208
  - CHANGELOG
259
209
  - LICENCE
@@ -271,27 +221,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
221
  requirements:
272
222
  - - ">="
273
223
  - !ruby/object:Gem::Version
274
- hash: 3
275
- segments:
276
- - 0
277
224
  version: "0"
278
225
  required_rubygems_version: !ruby/object:Gem::Requirement
279
226
  none: false
280
227
  requirements:
281
228
  - - ">="
282
229
  - !ruby/object:Gem::Version
283
- hash: 21
284
- segments:
285
- - 1
286
- - 3
287
- - 7
288
230
  version: 1.3.7
289
231
  requirements:
290
232
  - To use Memcached as caching back-end, install the 'dalli' gem.
291
233
  - To use multipart post, install the 'multipart-post' gem.
292
234
  - To use curl as the http engine, install the 'patron' gem. This feature is not available (and should be unneccessary) on jruby.
293
235
  rubyforge_project: wrest
294
- rubygems_version: 1.4.1
236
+ rubygems_version: 1.5.0
295
237
  signing_key:
296
238
  specification_version: 3
297
239
  summary: Wrest is an elegant, object oriented HTTP client library for 1.8, 1.9, JRuby and Rubinius.
@@ -1,78 +0,0 @@
1
- !RBIX
2
- 0
3
- x
4
- M
5
- 1
6
- n
7
- n
8
- x
9
- 10
10
- __script__
11
- i
12
- 23
13
- 5
14
- 45
15
- 0
16
- 1
17
- 65
18
- 49
19
- 2
20
- 0
21
- 49
22
- 3
23
- 1
24
- 7
25
- 4
26
- 64
27
- 81
28
- 5
29
- 47
30
- 49
31
- 6
32
- 1
33
- 15
34
- 2
35
- 11
36
- I
37
- 3
38
- I
39
- 0
40
- I
41
- 0
42
- I
43
- 0
44
- n
45
- p
46
- 7
47
- x
48
- 4
49
- File
50
- n
51
- x
52
- 11
53
- active_path
54
- x
55
- 7
56
- dirname
57
- s
58
- 15
59
- /wrest_shell.rb
60
- x
61
- 1
62
- +
63
- x
64
- 4
65
- load
66
- p
67
- 3
68
- I
69
- 0
70
- I
71
- 3
72
- I
73
- 17
74
- x
75
- 31
76
- /home/jasim/C42/wrest/bin/wrest
77
- p
78
- 0
@@ -1,659 +0,0 @@
1
- !RBIX
2
- 0
3
- x
4
- M
5
- 1
6
- n
7
- n
8
- x
9
- 10
10
- __script__
11
- i
12
- 245
13
- 5
14
- 7
15
- 0
16
- 45
17
- 1
18
- 2
19
- 47
20
- 49
21
- 3
22
- 0
23
- 7
24
- 4
25
- 45
26
- 5
27
- 6
28
- 47
29
- 49
30
- 3
31
- 0
32
- 7
33
- 4
34
- 45
35
- 7
36
- 8
37
- 47
38
- 49
39
- 3
40
- 0
41
- 63
42
- 6
43
- 47
44
- 49
45
- 9
46
- 1
47
- 15
48
- 45
49
- 10
50
- 11
51
- 45
52
- 10
53
- 12
54
- 65
55
- 49
56
- 13
57
- 0
58
- 49
59
- 14
60
- 1
61
- 47
62
- 49
63
- 3
64
- 0
65
- 7
66
- 15
67
- 63
68
- 2
69
- 49
70
- 16
71
- 1
72
- 19
73
- 0
74
- 15
75
- 45
76
- 10
77
- 17
78
- 45
79
- 10
80
- 18
81
- 65
82
- 49
83
- 13
84
- 0
85
- 49
86
- 14
87
- 1
88
- 47
89
- 49
90
- 3
91
- 0
92
- 7
93
- 19
94
- 63
95
- 2
96
- 49
97
- 16
98
- 1
99
- 19
100
- 1
101
- 15
102
- 45
103
- 7
104
- 20
105
- 7
106
- 21
107
- 13
108
- 70
109
- 9
110
- 110
111
- 15
112
- 44
113
- 43
114
- 22
115
- 7
116
- 23
117
- 78
118
- 49
119
- 24
120
- 2
121
- 6
122
- 21
123
- 49
124
- 25
125
- 1
126
- 9
127
- 120
128
- 7
129
- 26
130
- 64
131
- 8
132
- 123
133
- 7
134
- 27
135
- 64
136
- 19
137
- 2
138
- 15
139
- 5
140
- 7
141
- 28
142
- 64
143
- 47
144
- 49
145
- 29
146
- 1
147
- 15
148
- 44
149
- 43
150
- 30
151
- 79
152
- 49
153
- 31
154
- 1
155
- 13
156
- 7
157
- 32
158
- 20
159
- 2
160
- 49
161
- 33
162
- 2
163
- 15
164
- 19
165
- 3
166
- 15
167
- 45
168
- 34
169
- 35
170
- 56
171
- 36
172
- 50
173
- 24
174
- 0
175
- 15
176
- 7
177
- 37
178
- 64
179
- 19
180
- 4
181
- 15
182
- 20
183
- 4
184
- 7
185
- 38
186
- 20
187
- 0
188
- 47
189
- 49
190
- 3
191
- 0
192
- 63
193
- 2
194
- 49
195
- 39
196
- 1
197
- 15
198
- 5
199
- 20
200
- 1
201
- 47
202
- 49
203
- 29
204
- 1
205
- 15
206
- 5
207
- 7
208
- 40
209
- 45
210
- 41
211
- 42
212
- 43
213
- 43
214
- 43
215
- 44
216
- 47
217
- 49
218
- 3
219
- 0
220
- 63
221
- 2
222
- 47
223
- 49
224
- 9
225
- 1
226
- 15
227
- 5
228
- 20
229
- 3
230
- 7
231
- 32
232
- 49
233
- 45
234
- 1
235
- 47
236
- 49
237
- 3
238
- 0
239
- 7
240
- 46
241
- 20
242
- 4
243
- 47
244
- 49
245
- 3
246
- 0
247
- 7
248
- 47
249
- 63
250
- 4
251
- 47
252
- 49
253
- 48
254
- 1
255
- 15
256
- 2
257
- 11
258
- I
259
- c
260
- I
261
- 5
262
- I
263
- 0
264
- I
265
- 0
266
- n
267
- p
268
- 49
269
- s
270
- 5
271
- Ruby
272
- x
273
- 12
274
- RUBY_VERSION
275
- n
276
- x
277
- 4
278
- to_s
279
- s
280
- 2
281
- ,
282
- x
283
- 17
284
- RUBY_RELEASE_DATE
285
- n
286
- x
287
- 13
288
- RUBY_PLATFORM
289
- n
290
- x
291
- 4
292
- puts
293
- x
294
- 4
295
- File
296
- n
297
- n
298
- x
299
- 11
300
- active_path
301
- x
302
- 7
303
- dirname
304
- s
305
- 16
306
- /../lib/wrest.rb
307
- x
308
- 11
309
- expand_path
310
- n
311
- n
312
- s
313
- 24
314
- /../lib/wrest/version.rb
315
- n
316
- n
317
- x
318
- 6
319
- Regexp
320
- s
321
- 15
322
- (:?mswin|mingw)
323
- x
324
- 3
325
- new
326
- x
327
- 2
328
- =~
329
- s
330
- 7
331
- irb.bat
332
- s
333
- 3
334
- irb
335
- s
336
- 8
337
- optparse
338
- x
339
- 7
340
- require
341
- x
342
- 4
343
- Hash
344
- x
345
- 16
346
- new_from_literal
347
- x
348
- 3
349
- irb
350
- x
351
- 3
352
- []=
353
- x
354
- 12
355
- OptionParser
356
- n
357
- M
358
- 1
359
- p
360
- 2
361
- x
362
- 9
363
- for_block
364
- t
365
- n
366
- x
367
- 9
368
- __block__
369
- i
370
- 50
371
- 57
372
- 19
373
- 0
374
- 15
375
- 20
376
- 0
377
- 7
378
- 0
379
- 64
380
- 13
381
- 18
382
- 2
383
- 49
384
- 1
385
- 1
386
- 15
387
- 15
388
- 20
389
- 0
390
- 7
391
- 2
392
- 21
393
- 1
394
- 2
395
- 47
396
- 49
397
- 3
398
- 0
399
- 7
400
- 4
401
- 63
402
- 3
403
- 7
404
- 5
405
- 64
406
- 56
407
- 6
408
- 50
409
- 7
410
- 2
411
- 15
412
- 20
413
- 0
414
- 45
415
- 8
416
- 9
417
- 49
418
- 10
419
- 1
420
- 11
421
- I
422
- 6
423
- I
424
- 1
425
- I
426
- 1
427
- I
428
- 1
429
- n
430
- p
431
- 11
432
- s
433
- 24
434
- Usage: console [options]
435
- x
436
- 7
437
- banner=
438
- s
439
- 7
440
- --irb=[
441
- x
442
- 4
443
- to_s
444
- s
445
- 1
446
- ]
447
- s
448
- 23
449
- Invoke a different irb.
450
- M
451
- 1
452
- p
453
- 2
454
- x
455
- 9
456
- for_block
457
- t
458
- n
459
- x
460
- 9
461
- __block__
462
- i
463
- 19
464
- 57
465
- 19
466
- 0
467
- 15
468
- 21
469
- 2
470
- 3
471
- 7
472
- 0
473
- 20
474
- 0
475
- 13
476
- 18
477
- 3
478
- 49
479
- 1
480
- 2
481
- 15
482
- 11
483
- I
484
- 6
485
- I
486
- 1
487
- I
488
- 1
489
- I
490
- 1
491
- n
492
- p
493
- 2
494
- x
495
- 3
496
- irb
497
- x
498
- 3
499
- []=
500
- p
501
- 3
502
- I
503
- 0
504
- I
505
- c
506
- I
507
- 13
508
- x
509
- 40
510
- /home/jasim/C42/wrest/bin/wrest_shell.rb
511
- p
512
- 1
513
- x
514
- 1
515
- v
516
- x
517
- 2
518
- on
519
- x
520
- 4
521
- ARGV
522
- n
523
- x
524
- 6
525
- parse!
526
- p
527
- 9
528
- I
529
- 0
530
- I
531
- a
532
- I
533
- 4
534
- I
535
- b
536
- I
537
- 11
538
- I
539
- c
540
- I
541
- 29
542
- I
543
- d
544
- I
545
- 32
546
- x
547
- 40
548
- /home/jasim/C42/wrest/bin/wrest_shell.rb
549
- p
550
- 1
551
- x
552
- 3
553
- opt
554
- s
555
- 18
556
- -r irb/completion
557
- s
558
- 4
559
- -r
560
- x
561
- 2
562
- <<
563
- s
564
- 14
565
- Loading Wrest
566
- x
567
- 5
568
- Wrest
569
- n
570
- x
571
- 7
572
- VERSION
573
- x
574
- 6
575
- STRING
576
- x
577
- 2
578
- []
579
- s
580
- 1
581
-
582
- s
583
- 16
584
- --simple-prompt
585
- x
586
- 4
587
- exec
588
- p
589
- 25
590
- I
591
- 0
592
- I
593
- 1
594
- I
595
- 23
596
- I
597
- 3
598
- I
599
- 3e
600
- I
601
- 4
602
- I
603
- 59
604
- I
605
- 6
606
- I
607
- 7e
608
- I
609
- 8
610
- I
611
- 87
612
- I
613
- 9
614
- I
615
- 9a
616
- I
617
- a
618
- I
619
- a3
620
- I
621
- 10
622
- I
623
- a9
624
- I
625
- 11
626
- I
627
- b9
628
- I
629
- 13
630
- I
631
- c1
632
- I
633
- 14
634
- I
635
- d6
636
- I
637
- 15
638
- I
639
- f5
640
- x
641
- 40
642
- /home/jasim/C42/wrest/bin/wrest_shell.rb
643
- p
644
- 5
645
- x
646
- 11
647
- entry_point
648
- x
649
- 7
650
- version
651
- x
652
- 3
653
- irb
654
- x
655
- 7
656
- options
657
- x
658
- 4
659
- libs