esod-client 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/command_line_options.rb +3 -6
- data/esod-client.gemspec +29 -27
- data/lib/esod_client/esod_client.rb +2 -2
- data/lib/rest-client-1.4.2/README.rdoc +243 -0
- data/lib/rest-client-1.4.2/Rakefile +60 -0
- data/lib/rest-client-1.4.2/VERSION +1 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/bin/restclient +0 -0
- data/lib/rest-client-1.4.2/history.md +54 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/lib/rest_client.rb +0 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/lib/restclient.rb +77 -21
- data/lib/rest-client-1.4.2/lib/restclient/abstract_response.rb +87 -0
- data/lib/rest-client-1.4.2/lib/restclient/exceptions.rb +146 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/lib/restclient/net_http_ext.rb +0 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/lib/restclient/payload.rb +15 -12
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/lib/restclient/raw_response.rb +7 -6
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/lib/restclient/request.rb +61 -89
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/lib/restclient/resource.rb +11 -10
- data/lib/rest-client-1.4.2/lib/restclient/response.rb +46 -0
- data/lib/{rest-client-1.2.0/spec/mixin/response_spec.rb → rest-client-1.4.2/spec/abstract_response_spec.rb} +3 -12
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/spec/base.rb +0 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/spec/exceptions_spec.rb +23 -9
- data/lib/rest-client-1.4.2/spec/integration_spec.rb +38 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/spec/master_shake.jpg +0 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/spec/payload_spec.rb +20 -6
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/spec/raw_response_spec.rb +1 -1
- data/lib/rest-client-1.4.2/spec/request_spec.rb +518 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/spec/resource_spec.rb +24 -0
- data/lib/rest-client-1.4.2/spec/response_spec.rb +130 -0
- data/lib/{rest-client-1.2.0 → rest-client-1.4.2}/spec/restclient_spec.rb +21 -11
- metadata +38 -29
- data/lib/rest-client-1.2.0/README.rdoc +0 -102
- data/lib/rest-client-1.2.0/Rakefile +0 -57
- data/lib/rest-client-1.2.0/VERSION +0 -1
- data/lib/rest-client-1.2.0/lib/restclient/exceptions.rb +0 -89
- data/lib/rest-client-1.2.0/lib/restclient/mixin/response.rb +0 -48
- data/lib/rest-client-1.2.0/lib/restclient/response.rb +0 -20
- data/lib/rest-client-1.2.0/spec/request_spec.rb +0 -521
- data/lib/rest-client-1.2.0/spec/response_spec.rb +0 -21
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/command_line_options.rb
CHANGED
@@ -10,10 +10,7 @@ Options:
|
|
10
10
|
opt :property, "Property of the resource, dotted notation (ex: vm_configuration_parameters.first.name)", :type => :string, :required => false
|
11
11
|
opt :api_token, "User authentication token", :type => :string, :required => true
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
|
+
if ( $options[:resource] || $options[:id] ) && $options[:resource_path]
|
14
15
|
Trollop::die :resource_path, "cannot be specified if --resource and --id options are used. Use either --resource-path OR --resource and --id."
|
15
|
-
|
16
|
-
if $options[:resource] || $options[:id]
|
17
|
-
Trollop::die :resource, "cannot be specified if --resource-path option is used. Use either --resource-path OR --resource and --id."
|
18
|
-
end
|
19
|
-
end
|
16
|
+
end
|
data/esod-client.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{esod-client}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Yan Pritzker", "CohesiveFT"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-06}
|
13
13
|
s.description = %q{Consume REST services from Elastic Server On Demand.}
|
14
14
|
s.email = %q{support@elasticserver.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -78,36 +78,38 @@ Gem::Specification.new do |s|
|
|
78
78
|
"lib/mime-types-1.16/setup.rb",
|
79
79
|
"lib/mime-types-1.16/test/test_mime_type.rb",
|
80
80
|
"lib/mime-types-1.16/test/test_mime_types.rb",
|
81
|
-
"lib/rest-client-1.2
|
82
|
-
"lib/rest-client-1.2
|
83
|
-
"lib/rest-client-1.2
|
84
|
-
"lib/rest-client-1.2
|
85
|
-
"lib/rest-client-1.2
|
86
|
-
"lib/rest-client-1.2
|
87
|
-
"lib/rest-client-1.2
|
88
|
-
"lib/rest-client-1.2
|
89
|
-
"lib/rest-client-1.2
|
90
|
-
"lib/rest-client-1.2
|
91
|
-
"lib/rest-client-1.2
|
92
|
-
"lib/rest-client-1.2
|
93
|
-
"lib/rest-client-1.2
|
94
|
-
"lib/rest-client-1.2
|
95
|
-
"lib/rest-client-1.2
|
96
|
-
"lib/rest-client-1.2
|
97
|
-
"lib/rest-client-1.2
|
98
|
-
"lib/rest-client-1.2
|
99
|
-
"lib/rest-client-1.2
|
100
|
-
"lib/rest-client-1.2
|
101
|
-
"lib/rest-client-1.2
|
102
|
-
"lib/rest-client-1.2
|
103
|
-
"lib/rest-client-1.2
|
104
|
-
"lib/rest-client-1.2
|
81
|
+
"lib/rest-client-1.4.2/README.rdoc",
|
82
|
+
"lib/rest-client-1.4.2/Rakefile",
|
83
|
+
"lib/rest-client-1.4.2/VERSION",
|
84
|
+
"lib/rest-client-1.4.2/bin/restclient",
|
85
|
+
"lib/rest-client-1.4.2/history.md",
|
86
|
+
"lib/rest-client-1.4.2/lib/rest_client.rb",
|
87
|
+
"lib/rest-client-1.4.2/lib/restclient.rb",
|
88
|
+
"lib/rest-client-1.4.2/lib/restclient/abstract_response.rb",
|
89
|
+
"lib/rest-client-1.4.2/lib/restclient/exceptions.rb",
|
90
|
+
"lib/rest-client-1.4.2/lib/restclient/net_http_ext.rb",
|
91
|
+
"lib/rest-client-1.4.2/lib/restclient/payload.rb",
|
92
|
+
"lib/rest-client-1.4.2/lib/restclient/raw_response.rb",
|
93
|
+
"lib/rest-client-1.4.2/lib/restclient/request.rb",
|
94
|
+
"lib/rest-client-1.4.2/lib/restclient/resource.rb",
|
95
|
+
"lib/rest-client-1.4.2/lib/restclient/response.rb",
|
96
|
+
"lib/rest-client-1.4.2/spec/abstract_response_spec.rb",
|
97
|
+
"lib/rest-client-1.4.2/spec/base.rb",
|
98
|
+
"lib/rest-client-1.4.2/spec/exceptions_spec.rb",
|
99
|
+
"lib/rest-client-1.4.2/spec/integration_spec.rb",
|
100
|
+
"lib/rest-client-1.4.2/spec/master_shake.jpg",
|
101
|
+
"lib/rest-client-1.4.2/spec/payload_spec.rb",
|
102
|
+
"lib/rest-client-1.4.2/spec/raw_response_spec.rb",
|
103
|
+
"lib/rest-client-1.4.2/spec/request_spec.rb",
|
104
|
+
"lib/rest-client-1.4.2/spec/resource_spec.rb",
|
105
|
+
"lib/rest-client-1.4.2/spec/response_spec.rb",
|
106
|
+
"lib/rest-client-1.4.2/spec/restclient_spec.rb",
|
105
107
|
"lib/trollop.rb"
|
106
108
|
]
|
107
109
|
s.homepage = %q{http://github.com/cohesive/esod-client}
|
108
110
|
s.rdoc_options = ["--charset=UTF-8"]
|
109
111
|
s.require_paths = ["lib"]
|
110
|
-
s.rubygems_version = %q{1.3.
|
112
|
+
s.rubygems_version = %q{1.3.6}
|
111
113
|
s.summary = %q{ESOD REST Client}
|
112
114
|
|
113
115
|
if s.respond_to? :specification_version then
|
@@ -14,7 +14,7 @@ class ESODClient
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def get_path(path)
|
17
|
-
response = RestClient.get("#{
|
17
|
+
response = RestClient.get(URI.join(@url, "#{path}.xml?key=#{@token}").to_s).to_s
|
18
18
|
response_hash = Hash.from_xml(response)
|
19
19
|
end
|
20
|
-
end
|
20
|
+
end
|
@@ -0,0 +1,243 @@
|
|
1
|
+
= REST Client -- simple DSL for accessing HTTP and REST resources
|
2
|
+
|
3
|
+
A simple HTTP and REST client for Ruby, inspired by the Sinatra's microframework style
|
4
|
+
of specifying actions: get, put, post, delete.
|
5
|
+
|
6
|
+
== Usage: Raw URL
|
7
|
+
|
8
|
+
require 'rest_client'
|
9
|
+
|
10
|
+
RestClient.get 'http://example.com/resource'
|
11
|
+
|
12
|
+
RestClient.get 'https://user:password@example.com/private/resource'
|
13
|
+
|
14
|
+
RestClient.post 'http://example.com/resource', :param1 => 'one', :nested => { :param2 => 'two' }
|
15
|
+
|
16
|
+
RestClient.post "http://example.com/resource", { 'x' => 1 }.to_json, :content_type => :json, :accept => :json
|
17
|
+
|
18
|
+
RestClient.delete 'http://example.com/resource'
|
19
|
+
|
20
|
+
== Multipart
|
21
|
+
|
22
|
+
Yeah, that's right! This does multipart sends for you!
|
23
|
+
|
24
|
+
RestClient.post '/data', :myfile => File.new("/path/to/image.jpg")
|
25
|
+
|
26
|
+
This does two things for you:
|
27
|
+
|
28
|
+
* Auto-detects that you have a File value sends it as multipart
|
29
|
+
* Auto-detects the mime of the file and sets it in the HEAD of the payload for each entry
|
30
|
+
|
31
|
+
If you are sending params that do not contain a File object but the payload needs to be multipart then:
|
32
|
+
|
33
|
+
RestClient.post '/data', :foo => 'bar', :multipart => true
|
34
|
+
|
35
|
+
== Usage: ActiveResource-Style
|
36
|
+
|
37
|
+
resource = RestClient::Resource.new 'http://example.com/resource'
|
38
|
+
resource.get
|
39
|
+
|
40
|
+
private_resource = RestClient::Resource.new 'https://example.com/private/resource', 'user', 'pass'
|
41
|
+
private_resource.put File.read('pic.jpg'), :content_type => 'image/jpg'
|
42
|
+
|
43
|
+
See RestClient::Resource module docs for details.
|
44
|
+
|
45
|
+
== Usage: Resource Nesting
|
46
|
+
|
47
|
+
site = RestClient::Resource.new('http://example.com')
|
48
|
+
site['posts/1/comments'].post 'Good article.', :content_type => 'text/plain'
|
49
|
+
|
50
|
+
See RestClient::Resource docs for details.
|
51
|
+
|
52
|
+
== Exceptions (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)
|
53
|
+
|
54
|
+
* for results code between 200 and 206 a RestClient::Response will be returned
|
55
|
+
* for results code 301 and 302 the redirection will be followed if the request is a get or a head
|
56
|
+
* for result code 303 the redirection will be followed and the request transformed into a get
|
57
|
+
* for other cases a RestClient::Exception holding the Response will be raised, a specific exception class will be thrown for know error codes
|
58
|
+
|
59
|
+
RestClient.get 'http://example.com/resource'
|
60
|
+
➔ RestClient::ResourceNotFound: RestClient::ResourceNotFound
|
61
|
+
|
62
|
+
begin
|
63
|
+
RestClient.get 'http://example.com/resource'
|
64
|
+
rescue => e
|
65
|
+
e.response
|
66
|
+
end
|
67
|
+
➔ 404 Resource Not Found | text/html 282 bytes
|
68
|
+
|
69
|
+
== Result handling
|
70
|
+
|
71
|
+
A block can be passed to the RestClient method, this block will then be called with the Response.
|
72
|
+
Response.return! can be called to invoke the default response's behavior.
|
73
|
+
|
74
|
+
# Don't raise exceptions but return the response
|
75
|
+
RestClient.get('http://example.com/resource'){|response| response }
|
76
|
+
➔ 404 Resource Not Found | text/html 282 bytes
|
77
|
+
|
78
|
+
# Manage a specific error code
|
79
|
+
RestClient.get('http://my-rest-service.com/resource'){ |response, &block|
|
80
|
+
case response.code
|
81
|
+
when 200
|
82
|
+
p "It worked !"
|
83
|
+
response
|
84
|
+
when 423
|
85
|
+
raise SomeCustomExceptionIfYouWant
|
86
|
+
else
|
87
|
+
response.return! &block
|
88
|
+
end
|
89
|
+
}
|
90
|
+
|
91
|
+
# Follow redirections for all request types and not only for get and head
|
92
|
+
# RFC : "If the 301 (or 302) status code is received in response to a request other than GET or HEAD,
|
93
|
+
# the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user,
|
94
|
+
# since this might change the conditions under which the request was issued."
|
95
|
+
RestClient.get('http://my-rest-service.com/resource'){ |response, &block|
|
96
|
+
if [301, 302].include? response.code
|
97
|
+
response.follow_redirection &block
|
98
|
+
else
|
99
|
+
response.return! &block
|
100
|
+
end
|
101
|
+
}
|
102
|
+
|
103
|
+
== Non-normalized URIs.
|
104
|
+
|
105
|
+
If you want to use non-normalized URIs, you can normalize them with the addressable gem (http://addressable.rubyforge.org/api/).
|
106
|
+
|
107
|
+
require 'addressable/uri'
|
108
|
+
RestClient.get(Addressable::URI.parse("http://www.詹姆斯.com/").normalize.to_str)
|
109
|
+
|
110
|
+
== Lower-level access
|
111
|
+
|
112
|
+
For cases not covered by the general API, you can use the RestClient::Resource class which provide a lower-level API, see the class' rdoc for more information.
|
113
|
+
|
114
|
+
== Shell
|
115
|
+
|
116
|
+
The restclient shell command gives an IRB session with RestClient already loaded:
|
117
|
+
|
118
|
+
$ restclient
|
119
|
+
>> RestClient.get 'http://example.com'
|
120
|
+
|
121
|
+
Specify a URL argument for get/post/put/delete on that resource:
|
122
|
+
|
123
|
+
$ restclient http://example.com
|
124
|
+
>> put '/resource', 'data'
|
125
|
+
|
126
|
+
Add a user and password for authenticated resources:
|
127
|
+
|
128
|
+
$ restclient https://example.com user pass
|
129
|
+
>> delete '/private/resource'
|
130
|
+
|
131
|
+
Create ~/.restclient for named sessions:
|
132
|
+
|
133
|
+
sinatra:
|
134
|
+
url: http://localhost:4567
|
135
|
+
rack:
|
136
|
+
url: http://localhost:9292
|
137
|
+
private_site:
|
138
|
+
url: http://example.com
|
139
|
+
username: user
|
140
|
+
password: pass
|
141
|
+
|
142
|
+
Then invoke:
|
143
|
+
|
144
|
+
$ restclient private_site
|
145
|
+
|
146
|
+
Use as a one-off, curl-style:
|
147
|
+
|
148
|
+
$ restclient get http://example.com/resource > output_body
|
149
|
+
|
150
|
+
$ restclient put http://example.com/resource < input_body
|
151
|
+
|
152
|
+
== Logging
|
153
|
+
|
154
|
+
To enable logging you can
|
155
|
+
|
156
|
+
* set RestClient.log with a ruby Logger
|
157
|
+
* or set an environment variable to avoid modifying the code (in this case you can use a file name, "stdout" or "stderr"):
|
158
|
+
|
159
|
+
$ RESTCLIENT_LOG=stdout path/to/my/program
|
160
|
+
|
161
|
+
Either produces logs like this:
|
162
|
+
|
163
|
+
RestClient.get "http://some/resource"
|
164
|
+
# => 200 OK | text/html 250 bytes
|
165
|
+
RestClient.put "http://some/resource", "payload"
|
166
|
+
# => 401 Unauthorized | application/xml 340 bytes
|
167
|
+
|
168
|
+
Note that these logs are valid Ruby, so you can paste them into the restclient
|
169
|
+
shell or a script to replay your sequence of rest calls.
|
170
|
+
|
171
|
+
== Proxy
|
172
|
+
|
173
|
+
All calls to RestClient, including Resources, will use the proxy specified by
|
174
|
+
RestClient.proxy:
|
175
|
+
|
176
|
+
RestClient.proxy = "http://proxy.example.com/"
|
177
|
+
RestClient.get "http://some/resource"
|
178
|
+
# => response from some/resource as proxied through proxy.example.com
|
179
|
+
|
180
|
+
Often the proxy url is set in an environment variable, so you can do this to
|
181
|
+
use whatever proxy the system is configured to use:
|
182
|
+
|
183
|
+
RestClient.proxy = ENV['http_proxy']
|
184
|
+
|
185
|
+
== Cookies
|
186
|
+
|
187
|
+
Request and Response objects know about HTTP cookies, and will automatically
|
188
|
+
extract and set headers for them as needed:
|
189
|
+
|
190
|
+
response = RestClient.get 'http://example.com/action_which_sets_session_id'
|
191
|
+
response.cookies
|
192
|
+
# => {"_applicatioN_session_id" => "1234"}
|
193
|
+
|
194
|
+
response2 = RestClient.post(
|
195
|
+
'http://localhost:3000/',
|
196
|
+
{:param1 => "foo"},
|
197
|
+
{:cookies => {:session_id => "1234"}}
|
198
|
+
)
|
199
|
+
# ...response body
|
200
|
+
|
201
|
+
== SSL Client Certificates
|
202
|
+
|
203
|
+
RestClient::Resource.new(
|
204
|
+
'https://example.com',
|
205
|
+
:ssl_client_cert => OpenSSL::X509::Certificate.new(File.read("cert.pem")),
|
206
|
+
:ssl_client_key => OpenSSL::PKey::RSA.new(File.read("key.pem"), "passphrase, if any"),
|
207
|
+
:ssl_ca_file => "ca_certificate.pem",
|
208
|
+
:verify_ssl => OpenSSL::SSL::VERIFY_PEER
|
209
|
+
).get
|
210
|
+
|
211
|
+
Self-signed certificates can be generated with the openssl command-line tool.
|
212
|
+
|
213
|
+
== Hook
|
214
|
+
|
215
|
+
RestClient.add_before_execution_proc add a Proc to be called before each execution, it's handy if you need a direct access to the http request.
|
216
|
+
|
217
|
+
Example:
|
218
|
+
|
219
|
+
# Add oath support using the oauth gem
|
220
|
+
require 'oauth'
|
221
|
+
access_token = ...
|
222
|
+
|
223
|
+
RestClient.add_before_execution_proc do |req, params|
|
224
|
+
access_token.sign! req
|
225
|
+
end
|
226
|
+
|
227
|
+
RestClient.get 'http://example.com'
|
228
|
+
|
229
|
+
== Meta
|
230
|
+
|
231
|
+
Written by Adam Wiggins, major modifications by Blake Mizerany, maintained by Julien Kirch
|
232
|
+
|
233
|
+
Patches contributed by many, including Chris Anderson, Greg Borenstein, Ardekantur, Pedro Belo, Rafael Souza, Rick Olson, Aman Gupta, François Beausoleil and Nick Plante.
|
234
|
+
|
235
|
+
Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
|
236
|
+
|
237
|
+
Main page: http://github.com/archiloque/rest-client
|
238
|
+
|
239
|
+
Rdoc: http://rdoc.info/projects/archiloque/rest-client
|
240
|
+
|
241
|
+
Mailing list: rest.client@librelist.com (send a mail to subscribe).
|
242
|
+
|
243
|
+
IRC: #rest-client at freenode
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
require 'jeweler'
|
4
|
+
|
5
|
+
Jeweler::Tasks.new do |s|
|
6
|
+
s.name = "rest-client"
|
7
|
+
s.description = "A simple HTTP and REST client for Ruby, inspired by the Sinatra microframework style of specifying actions: get, put, post, delete."
|
8
|
+
s.summary = "Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions."
|
9
|
+
s.author = "Adam Wiggins"
|
10
|
+
s.email = "rest.client@librelist.com"
|
11
|
+
s.homepage = "http://github.com/archiloque/rest-client"
|
12
|
+
s.rubyforge_project = "rest-client"
|
13
|
+
s.has_rdoc = true
|
14
|
+
s.files = FileList["[A-Z]*", "{bin,lib,spec}/**/*"]
|
15
|
+
s.executables = %w(restclient)
|
16
|
+
s.add_dependency("mime-types", ">= 1.16")
|
17
|
+
s.add_development_dependency("webmock", ">= 0.9.1")
|
18
|
+
s.add_development_dependency("rspec")
|
19
|
+
end
|
20
|
+
|
21
|
+
Jeweler::RubyforgeTasks.new
|
22
|
+
|
23
|
+
############################
|
24
|
+
|
25
|
+
require 'spec/rake/spectask'
|
26
|
+
|
27
|
+
desc "Run all specs"
|
28
|
+
Spec::Rake::SpecTask.new('spec') do |t|
|
29
|
+
t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
|
30
|
+
t.spec_files = FileList['spec/*_spec.rb']
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "Print specdocs"
|
34
|
+
Spec::Rake::SpecTask.new(:doc) do |t|
|
35
|
+
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
36
|
+
t.spec_files = FileList['spec/*_spec.rb']
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "Run all examples with RCov"
|
40
|
+
Spec::Rake::SpecTask.new('rcov') do |t|
|
41
|
+
t.spec_files = FileList['spec/*_spec.rb']
|
42
|
+
t.rcov = true
|
43
|
+
t.rcov_opts = ['--exclude', 'examples']
|
44
|
+
end
|
45
|
+
|
46
|
+
task :default => :spec
|
47
|
+
|
48
|
+
############################
|
49
|
+
|
50
|
+
require 'rake/rdoctask'
|
51
|
+
|
52
|
+
Rake::RDocTask.new do |t|
|
53
|
+
t.rdoc_dir = 'rdoc'
|
54
|
+
t.title = "rest-client, fetch RESTful resources effortlessly"
|
55
|
+
t.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
|
56
|
+
t.options << '--charset' << 'utf-8'
|
57
|
+
t.rdoc_files.include('README.rdoc')
|
58
|
+
t.rdoc_files.include('lib/*.rb')
|
59
|
+
end
|
60
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
1.4.2
|
File without changes
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# 1.4.2
|
2
|
+
|
3
|
+
- fixed RestClient.add_before_execution_proc (patch provided by Nicholas Wieland)
|
4
|
+
- fixed error when an exception is raised without a response (patch provided by Caleb Land)
|
5
|
+
|
6
|
+
# 1.4.1
|
7
|
+
|
8
|
+
- fixed parameters managment when using hash
|
9
|
+
|
10
|
+
# 1.4.0
|
11
|
+
|
12
|
+
- Response is no more a String, and the mixin is replaced by an abstract_response, existing calls are redirected to response body with a warning.
|
13
|
+
- enable repeated parameters RestClient.post 'http://example.com/resource', :param1 => ['one', 'two', 'three'], => :param2 => 'foo' (patch provided by Rodrigo Panachi)
|
14
|
+
- fixed the redirect code concerning relative path and query string combination (patch provided by Kevin Read)
|
15
|
+
- redirection code moved to Response so redirection can be customized using the block syntax
|
16
|
+
- only get and head redirections are now followed by default, as stated in the specification
|
17
|
+
- added RestClient.add_before_execution_proc to hack the http request, like for oauth
|
18
|
+
|
19
|
+
The response change may be breaking in rare cases.
|
20
|
+
|
21
|
+
# 1.3.1
|
22
|
+
|
23
|
+
- added compatibility to enable responses in exception to act like Net::HTTPResponse
|
24
|
+
|
25
|
+
# 1.3.0
|
26
|
+
|
27
|
+
- a block can be used to process a request's result, this enable to handle custom error codes or paththrought (design by Cyril Rohr)
|
28
|
+
- cleaner log API, add a warning for some cases but should be compatible
|
29
|
+
- accept multiple "Set-Cookie" headers, see http://www.ietf.org/rfc/rfc2109.txt (patch provided by Cyril Rohr)
|
30
|
+
- remove "Content-Length" and "Content-Type" headers when following a redirection (patch provided by haarts)
|
31
|
+
- all http error codes have now a corresponding exception class and all of them contain the Reponse -> this means that the raised exception can be different
|
32
|
+
- changed "Content-Disposition: multipart/form-data" to "Content-Disposition: form-data" per RFC 2388 (patch provided by Kyle Crawford)
|
33
|
+
|
34
|
+
The only breaking change should be the exception classes, but as the new classes inherits from the existing ones, the breaking cases should be rare.
|
35
|
+
|
36
|
+
# 1.2.0
|
37
|
+
|
38
|
+
- formatting changed from tabs to spaces
|
39
|
+
- logged requests now include generated headers
|
40
|
+
- accept and content-type headers can now be specified using extentions: RestClient.post "http://example.com/resource", { 'x' => 1 }.to_json, :content_type => :json, :accept => :json
|
41
|
+
- should be 1.1.1 but renamed to 1.2.0 because 1.1.X versions has already been packaged on Debian
|
42
|
+
|
43
|
+
# 1.1.0
|
44
|
+
|
45
|
+
- new maintainer: Archiloque, the working repo is now at http://github.com/archiloque/rest-client
|
46
|
+
- a mailing list has been created at rest.client@librelist.com and an freenode irc channel #rest-client
|
47
|
+
- François Beausoleil' multipart code from http://github.com/francois/rest-client has been merged
|
48
|
+
- ability to use hash in hash as payload
|
49
|
+
- the mime-type code now rely on the mime-types gem http://mime-types.rubyforge.org/ instead of an internal partial list
|
50
|
+
- 204 response returns a Response instead of nil (patch provided by Elliott Draper)
|
51
|
+
|
52
|
+
All changes exept the last one should be fully compatible with the previous version.
|
53
|
+
|
54
|
+
NOTE: due to a dependency problem and to the last change, heroku users should update their heroku gem to >= 1.5.3 to be able to use this version.
|