rest-client 1.6.1 → 1.6.2.a
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.
Potentially problematic release.
This version of rest-client might be problematic. Click here for more details.
- data/README.rdoc +10 -2
- data/Rakefile +3 -2
- data/VERSION +1 -1
- data/bin/restclient +43 -38
- data/history.md +11 -0
- data/lib/restclient/abstract_response.rb +6 -2
- data/lib/restclient/exceptions.rb +14 -2
- data/lib/restclient/payload.rb +1 -1
- data/lib/restclient/request.rb +13 -5
- data/lib/restclient/resource.rb +8 -0
- data/spec/abstract_response_spec.rb +18 -0
- data/spec/exceptions_spec.rb +19 -0
- data/spec/request2_spec.rb +10 -0
- data/spec/resource_spec.rb +5 -0
- data/spec/response_spec.rb +13 -1
- metadata +57 -24
data/README.rdoc
CHANGED
@@ -12,7 +12,7 @@ of specifying actions: get, put, post, delete.
|
|
12
12
|
require 'rest_client'
|
13
13
|
|
14
14
|
RestClient.get 'http://example.com/resource'
|
15
|
-
|
15
|
+
|
16
16
|
RestClient.get 'http://example.com/resource', {:params => {:id => 50, 'foo' => 'bar'}}
|
17
17
|
|
18
18
|
RestClient.get 'https://user:password@example.com/private/resource', {:accept => :json}
|
@@ -137,7 +137,15 @@ If you want to use non-normalized URIs, you can normalize them with the addressa
|
|
137
137
|
|
138
138
|
== Lower-level access
|
139
139
|
|
140
|
-
For cases not covered by the general API, you can use the RestClient::
|
140
|
+
For cases not covered by the general API, you can use the RestClient::Request class which provide a lower-level API.
|
141
|
+
|
142
|
+
You can:
|
143
|
+
|
144
|
+
* specify ssl parameters
|
145
|
+
* override cookies
|
146
|
+
* manually handle the response (so you can operate on the response stream than reading it fully in memory)
|
147
|
+
|
148
|
+
see the class' rdoc for more information.
|
141
149
|
|
142
150
|
== Shell
|
143
151
|
|
data/Rakefile
CHANGED
@@ -6,16 +6,17 @@ Jeweler::Tasks.new do |s|
|
|
6
6
|
s.name = "rest-client"
|
7
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
8
|
s.summary = "Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions."
|
9
|
-
s.
|
9
|
+
s.authors = ["Adam Wiggins", "Julien Kirch"]
|
10
10
|
s.email = "rest.client@librelist.com"
|
11
11
|
s.homepage = "http://github.com/archiloque/rest-client"
|
12
12
|
s.rubyforge_project = "rest-client"
|
13
13
|
s.has_rdoc = true
|
14
14
|
s.files = FileList["[A-Z]*", "{bin,lib,spec}/**/*"]
|
15
15
|
s.executables = %w(restclient)
|
16
|
-
s.
|
16
|
+
s.add_runtime_dependency("mime-types", ">= 1.16")
|
17
17
|
s.add_development_dependency("webmock", ">= 0.9.1")
|
18
18
|
s.add_development_dependency("rspec")
|
19
|
+
s.extra_rdoc_files = [ 'README.rdoc', 'history.md']
|
19
20
|
end
|
20
21
|
|
21
22
|
Jeweler::RubyforgeTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.2.a
|
data/bin/restclient
CHANGED
@@ -6,17 +6,19 @@ require 'restclient'
|
|
6
6
|
require "yaml"
|
7
7
|
|
8
8
|
def usage(why = nil)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
puts "failed for reason: #{why}" if why
|
10
|
+
puts "usage: restclient [get|put|post|delete] url|name [username] [password]"
|
11
|
+
puts " The verb is optional, if you leave it off you'll get an interactive shell."
|
12
|
+
puts " put and post both take the input body on stdin."
|
13
|
+
exit(1)
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
POSSIBLE_VERBS = ['get', 'put', 'post', 'delete']
|
17
|
+
|
18
|
+
if POSSIBLE_VERBS.include? ARGV.first
|
19
|
+
@verb = ARGV.shift
|
18
20
|
else
|
19
|
-
|
21
|
+
@verb = nil
|
20
22
|
end
|
21
23
|
|
22
24
|
@url = ARGV.shift || 'http://localhost:4567'
|
@@ -24,61 +26,64 @@ end
|
|
24
26
|
config = YAML.load(File.read(ENV['HOME'] + "/.restclient")) rescue {}
|
25
27
|
|
26
28
|
@url, @username, @password = if c = config[@url]
|
27
|
-
|
29
|
+
[c['url'], c['username'], c['password']]
|
28
30
|
else
|
29
|
-
|
31
|
+
[@url, * ARGV]
|
30
32
|
end
|
31
33
|
|
32
34
|
usage("invalid url '#{@url}") unless @url =~ /^https?/
|
33
35
|
usage("too few args") unless ARGV.size < 3
|
34
36
|
|
35
37
|
def r
|
36
|
-
|
38
|
+
@r ||= RestClient::Resource.new(@url, @username, @password)
|
37
39
|
end
|
38
40
|
|
39
41
|
r # force rc to load
|
40
42
|
|
41
43
|
if @verb
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
44
|
+
begin
|
45
|
+
if %w( put post ).include? @verb
|
46
|
+
puts r.send(@verb, STDIN.read)
|
47
|
+
else
|
48
|
+
puts r.send(@verb)
|
49
|
+
end
|
50
|
+
exit 0
|
51
|
+
rescue RestClient::Exception => e
|
52
|
+
puts e.response.body if e.respond_to? :response
|
53
|
+
raise
|
54
|
+
end
|
53
55
|
end
|
54
56
|
|
55
|
-
|
56
|
-
|
57
|
-
def
|
58
|
-
r[path]
|
57
|
+
POSSIBLE_VERBS.each do |m|
|
58
|
+
eval <<-end_eval
|
59
|
+
def #{m} (path, *args, &b)
|
60
|
+
r[path]. #{m} (*args, &b)
|
59
61
|
end
|
60
|
-
|
62
|
+
end_eval
|
61
63
|
end
|
62
64
|
|
63
|
-
def method_missing(s, *args, &b)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
65
|
+
def method_missing(s, * args, & b)
|
66
|
+
if POSSIBLE_VERBS.include? s
|
67
|
+
begin
|
68
|
+
r.send(s, *args, & b)
|
69
|
+
rescue RestClient::RequestFailed => e
|
70
|
+
print STDERR, e.response.body
|
71
|
+
raise e
|
72
|
+
end
|
73
|
+
else
|
74
|
+
super
|
75
|
+
end
|
71
76
|
end
|
72
77
|
|
73
78
|
require 'irb'
|
74
79
|
require 'irb/completion'
|
75
80
|
|
76
81
|
if File.exists? ".irbrc"
|
77
|
-
|
82
|
+
ENV['IRBRC'] = ".irbrc"
|
78
83
|
end
|
79
84
|
|
80
|
-
if File.exists?(
|
81
|
-
|
85
|
+
if File.exists?(File.expand_path(rcfile = "~/.restclientrc"))
|
86
|
+
load(rcfile)
|
82
87
|
end
|
83
88
|
|
84
89
|
ARGV.clear
|
data/history.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
# 1.6.2
|
2
|
+
|
3
|
+
- add support for HEAD in resources (patch provided by tpresa)
|
4
|
+
- fix shell for 1.9.2
|
5
|
+
- workaround when some gem monkeypatch net/http (patch provided by Ian Warshak)
|
6
|
+
- DELETE requests should process parameters just like GET and HEAD
|
7
|
+
- adding :block_response parameter for manual processing
|
8
|
+
- limit number of redirections (patch provided by Chris Dinn)
|
9
|
+
- close and unlink the temp file created by playload (patch provided by Chris Green)
|
10
|
+
|
1
11
|
# 1.6.1
|
2
12
|
|
3
13
|
- add response body in Exception#inspect
|
@@ -6,6 +16,7 @@
|
|
6
16
|
- block passing in Resource#[] (patch provided by Niko Dittmann)
|
7
17
|
- cookies set in a response should be kept in a redirect
|
8
18
|
- HEAD requests should process parameters just like GET (patch provided by Rob Eanes)
|
19
|
+
- exception message should never be nil (patch provided by Michael Klett)
|
9
20
|
|
10
21
|
# 1.6.0
|
11
22
|
|
@@ -31,7 +31,7 @@ module RestClient
|
|
31
31
|
|
32
32
|
# Return the default behavior corresponding to the response code:
|
33
33
|
# the response itself for code in 200..206, redirection for 301, 302 and 307 in get and head cases, redirection for 303 and an exception in other cases
|
34
|
-
def return! request
|
34
|
+
def return! request = nil, result = nil, & block
|
35
35
|
if (200..207).include? code
|
36
36
|
self
|
37
37
|
elsif [301, 302, 307].include? code
|
@@ -47,7 +47,7 @@ module RestClient
|
|
47
47
|
elsif Exceptions::EXCEPTIONS_MAP[code]
|
48
48
|
raise Exceptions::EXCEPTIONS_MAP[code].new(self, code)
|
49
49
|
else
|
50
|
-
raise RequestFailed
|
50
|
+
raise RequestFailed.new(self, code)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -67,9 +67,13 @@ module RestClient
|
|
67
67
|
end
|
68
68
|
args[:url] = url
|
69
69
|
if request
|
70
|
+
if request.max_redirects == 0
|
71
|
+
raise MaxRedirectsReached
|
72
|
+
end
|
70
73
|
args[:password] = request.password
|
71
74
|
args[:user] = request.user
|
72
75
|
args[:headers] = request.headers
|
76
|
+
args[:max_redirects] = request.max_redirects - 1
|
73
77
|
# pass any cookie set in the result
|
74
78
|
if result && result['set-cookie']
|
75
79
|
args[:headers][:cookies] = (args[:headers][:cookies] || {}).merge(parse_cookie(result['set-cookie']))
|
@@ -80,7 +80,8 @@ module RestClient
|
|
80
80
|
# For example, the entire result body (which is
|
81
81
|
# probably an HTML error page) is e.response.
|
82
82
|
class Exception < RuntimeError
|
83
|
-
attr_accessor :
|
83
|
+
attr_accessor :response
|
84
|
+
attr_writer :message
|
84
85
|
|
85
86
|
def initialize response = nil, initial_response_code = nil
|
86
87
|
@response = response
|
@@ -110,6 +111,10 @@ module RestClient
|
|
110
111
|
def to_s
|
111
112
|
inspect
|
112
113
|
end
|
114
|
+
|
115
|
+
def message
|
116
|
+
@message || self.class.name
|
117
|
+
end
|
113
118
|
|
114
119
|
end
|
115
120
|
|
@@ -158,11 +163,18 @@ module RestClient
|
|
158
163
|
end
|
159
164
|
end
|
160
165
|
|
166
|
+
class MaxRedirectsReached < Exception
|
167
|
+
message = 'Maximum number of redirect reached'
|
168
|
+
end
|
169
|
+
|
161
170
|
# The server broke the connection prior to the request completing. Usually
|
162
171
|
# this means it crashed, or sometimes that your network connection was
|
163
172
|
# severed before it could complete.
|
164
173
|
class ServerBrokeConnection < Exception
|
165
|
-
message = 'Server broke connection'
|
174
|
+
def initialize(message = 'Server broke connection')
|
175
|
+
super nil, nil
|
176
|
+
self.message = message
|
177
|
+
end
|
166
178
|
end
|
167
179
|
|
168
180
|
class SSLCertificateNotVerified < Exception
|
data/lib/restclient/payload.rb
CHANGED
data/lib/restclient/request.rb
CHANGED
@@ -16,14 +16,16 @@ module RestClient
|
|
16
16
|
# * :headers a hash containing the request headers
|
17
17
|
# * :cookies will replace possible cookies in the :headers
|
18
18
|
# * :user and :password for basic auth, will be replaced by a user/password available in the :url
|
19
|
+
# * :block_response call the provided block with the HTTPResponse as parameter
|
19
20
|
# * :raw_response return a low-level RawResponse instead of a Response
|
21
|
+
# * :max_redirects maximum number of redirections (default to 10)
|
20
22
|
# * :verify_ssl enable ssl verification, possible values are constants from OpenSSL::SSL
|
21
23
|
# * :timeout and :open_timeout
|
22
24
|
# * :ssl_client_cert, :ssl_client_key, :ssl_ca_file
|
23
25
|
class Request
|
24
26
|
|
25
27
|
attr_reader :method, :url, :headers, :cookies,
|
26
|
-
:payload, :user, :password, :timeout,
|
28
|
+
:payload, :user, :password, :timeout, :max_redirects,
|
27
29
|
:open_timeout, :raw_response, :verify_ssl, :ssl_client_cert,
|
28
30
|
:ssl_client_key, :ssl_ca_file, :processed_headers, :args
|
29
31
|
|
@@ -45,12 +47,14 @@ module RestClient
|
|
45
47
|
@password = args[:password]
|
46
48
|
@timeout = args[:timeout]
|
47
49
|
@open_timeout = args[:open_timeout]
|
50
|
+
@block_response = args[:block_response]
|
48
51
|
@raw_response = args[:raw_response] || false
|
49
52
|
@verify_ssl = args[:verify_ssl] || false
|
50
53
|
@ssl_client_cert = args[:ssl_client_cert] || nil
|
51
54
|
@ssl_client_key = args[:ssl_client_key] || nil
|
52
55
|
@ssl_ca_file = args[:ssl_ca_file] || nil
|
53
56
|
@tf = nil # If you are a raw request, this is your tempfile
|
57
|
+
@max_redirects = args[:max_redirects] || 10
|
54
58
|
@processed_headers = make_headers headers
|
55
59
|
@args = args
|
56
60
|
end
|
@@ -62,7 +66,7 @@ module RestClient
|
|
62
66
|
|
63
67
|
# Extract the query parameters for get request and append them to the url
|
64
68
|
def process_get_params url, headers
|
65
|
-
if [:get, :head].include? method
|
69
|
+
if [:get, :head, :delete].include? method
|
66
70
|
get_params = {}
|
67
71
|
headers.delete_if do |key, value|
|
68
72
|
if 'params' == key.to_s.downcase && value.is_a?(Hash)
|
@@ -164,9 +168,13 @@ module RestClient
|
|
164
168
|
log_request
|
165
169
|
|
166
170
|
net.start do |http|
|
167
|
-
|
168
|
-
|
169
|
-
|
171
|
+
if @block_response
|
172
|
+
http.request(req, payload ? payload.to_s : nil, & @block_response)
|
173
|
+
else
|
174
|
+
res = http.request(req, payload ? payload.to_s : nil) { |http_response| fetch_body(http_response) }
|
175
|
+
log_response res
|
176
|
+
process_result res, & block
|
177
|
+
end
|
170
178
|
end
|
171
179
|
rescue EOFError
|
172
180
|
raise RestClient::ServerBrokeConnection
|
data/lib/restclient/resource.rb
CHANGED
@@ -54,6 +54,14 @@ module RestClient
|
|
54
54
|
:headers => headers), &(block || @block))
|
55
55
|
end
|
56
56
|
|
57
|
+
def head(additional_headers={}, &block)
|
58
|
+
headers = (options[:headers] || {}).merge(additional_headers)
|
59
|
+
Request.execute(options.merge(
|
60
|
+
:method => :head,
|
61
|
+
:url => url,
|
62
|
+
:headers => headers), &(block || @block))
|
63
|
+
end
|
64
|
+
|
57
65
|
def post(payload, additional_headers={}, &block)
|
58
66
|
headers = (options[:headers] || {}).merge(additional_headers)
|
59
67
|
Request.execute(options.merge(
|
@@ -64,4 +64,22 @@ describe RestClient::AbstractResponse do
|
|
64
64
|
it "can access the net http result directly" do
|
65
65
|
@response.net_http_res.should == @net_http_res
|
66
66
|
end
|
67
|
+
|
68
|
+
describe "#return!" do
|
69
|
+
it "should return the response itself on 200-codes" do
|
70
|
+
@net_http_res.should_receive(:code).and_return('200')
|
71
|
+
@response.return!.should be_equal(@response)
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should raise RequestFailed on unknown codes" do
|
75
|
+
@net_http_res.should_receive(:code).and_return('1000')
|
76
|
+
lambda { @response.return! }.should raise_error RestClient::RequestFailed
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should raise an error on a redirection after non-GET/HEAD requests" do
|
80
|
+
@net_http_res.should_receive(:code).and_return('301')
|
81
|
+
@response.args.merge(:method => :put)
|
82
|
+
lambda { @response.return! }.should raise_error RestClient::RequestFailed
|
83
|
+
end
|
84
|
+
end
|
67
85
|
end
|
data/spec/exceptions_spec.rb
CHANGED
@@ -4,6 +4,18 @@ require 'webmock/rspec'
|
|
4
4
|
include WebMock
|
5
5
|
|
6
6
|
describe RestClient::Exception do
|
7
|
+
it "returns a 'message' equal to the class name if the message is not set, because 'message' should not be nil" do
|
8
|
+
e = RestClient::Exception.new
|
9
|
+
e.message.should == "RestClient::Exception"
|
10
|
+
end
|
11
|
+
|
12
|
+
it "returns the 'message' that was set" do
|
13
|
+
e = RestClient::Exception.new
|
14
|
+
message = "An explicitly set message"
|
15
|
+
e.message = message
|
16
|
+
e.message.should == message
|
17
|
+
end
|
18
|
+
|
7
19
|
it "sets the exception message to ErrorMessage" do
|
8
20
|
RestClient::ResourceNotFound.new.message.should == 'Resource Not Found'
|
9
21
|
end
|
@@ -14,6 +26,13 @@ describe RestClient::Exception do
|
|
14
26
|
end
|
15
27
|
end
|
16
28
|
|
29
|
+
describe RestClient::ServerBrokeConnection do
|
30
|
+
it "should have a default message of 'Server broke connection'" do
|
31
|
+
e = RestClient::ServerBrokeConnection.new
|
32
|
+
e.message.should == 'Server broke connection'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
17
36
|
describe RestClient::RequestFailed do
|
18
37
|
before do
|
19
38
|
@response = mock('HTTP Response', :code => '502')
|
data/spec/request2_spec.rb
CHANGED
@@ -13,5 +13,15 @@ describe RestClient::Request do
|
|
13
13
|
RestClient::Request.execute(:url => 'http://some/resource', :method => :get, :headers => {:foo => :bar, :params => :a}).body.should == 'foo'
|
14
14
|
end
|
15
15
|
|
16
|
+
it "can use a block to process response" do
|
17
|
+
response_value = nil
|
18
|
+
block = Proc.new do |http_response|
|
19
|
+
response_value = http_response.body
|
20
|
+
end
|
21
|
+
stub_request(:get, 'http://some/resource?a=b&c=d').with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Foo'=>'bar'}).to_return(:body => 'foo', :status => 200)
|
22
|
+
RestClient::Request.execute(:url => 'http://some/resource', :method => :get, :headers => {:foo => :bar, :params => {:a => :b, 'c' => 'd'}}, :block_response => block)
|
23
|
+
response_value.should == "foo"
|
24
|
+
end
|
25
|
+
|
16
26
|
end
|
17
27
|
|
data/spec/resource_spec.rb
CHANGED
@@ -14,6 +14,11 @@ describe RestClient::Resource do
|
|
14
14
|
@resource.get
|
15
15
|
end
|
16
16
|
|
17
|
+
it "HEAD" do
|
18
|
+
RestClient::Request.should_receive(:execute).with(:method => :head, :url => 'http://some/resource', :headers => {'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
|
19
|
+
@resource.head
|
20
|
+
end
|
21
|
+
|
17
22
|
it "POST" do
|
18
23
|
RestClient::Request.should_receive(:execute).with(:method => :post, :url => 'http://some/resource', :payload => 'abc', :headers => {:content_type => 'image/jpg', 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
|
19
24
|
@resource.post 'abc', :content_type => 'image/jpg'
|
data/spec/response_spec.rb
CHANGED
@@ -149,8 +149,20 @@ describe RestClient::Response do
|
|
149
149
|
stub_request(:get, 'http://new/resource').to_return(:body => 'Foo')
|
150
150
|
RestClient::Request.execute(:url => 'http://some/resource', :method => :get).body.should == 'Foo'
|
151
151
|
end
|
152
|
-
|
153
152
|
|
153
|
+
it "follows no more than 10 redirections before raising error" do
|
154
|
+
stub_request(:get, 'http://some/redirect-1').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/redirect-2'})
|
155
|
+
stub_request(:get, 'http://some/redirect-2').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/redirect-2'})
|
156
|
+
lambda { RestClient::Request.execute(:url => 'http://some/redirect-1', :method => :get) }.should raise_error(RestClient::MaxRedirectsReached)
|
157
|
+
WebMock.should have_requested(:get, 'http://some/redirect-2').times(10)
|
158
|
+
end
|
159
|
+
|
160
|
+
it "follows no more than max_redirects redirections, if specified" do
|
161
|
+
stub_request(:get, 'http://some/redirect-1').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/redirect-2'})
|
162
|
+
stub_request(:get, 'http://some/redirect-2').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/redirect-2'})
|
163
|
+
lambda { RestClient::Request.execute(:url => 'http://some/redirect-1', :method => :get, :max_redirects => 5) }.should raise_error(RestClient::MaxRedirectsReached)
|
164
|
+
WebMock.should have_requested(:get, 'http://some/redirect-2').times(5)
|
165
|
+
end
|
154
166
|
end
|
155
167
|
|
156
168
|
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 2
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
|
9
|
+
- 2
|
10
|
+
- a
|
11
|
+
version: 1.6.2.a
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Adam Wiggins
|
@@ -16,7 +17,7 @@ autorequire:
|
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
19
|
|
19
|
-
date:
|
20
|
+
date: 2011-02-13 00:00:00 +01:00
|
20
21
|
default_executable: restclient
|
21
22
|
dependencies:
|
22
23
|
- !ruby/object:Gem::Dependency
|
@@ -34,7 +35,37 @@ dependencies:
|
|
34
35
|
version: "1.16"
|
35
36
|
type: :runtime
|
36
37
|
version_requirements: *id001
|
37
|
-
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: webmock
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 57
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
- 9
|
50
|
+
- 1
|
51
|
+
version: 0.9.1
|
52
|
+
type: :development
|
53
|
+
version_requirements: *id002
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rspec
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
type: :development
|
67
|
+
version_requirements: *id003
|
68
|
+
description: "A simple HTTP and REST client for Ruby, inspired by the Sinatra microframework style of specifying actions: get, put, post, delete."
|
38
69
|
email: rest.client@librelist.com
|
39
70
|
executables:
|
40
71
|
- restclient
|
@@ -48,40 +79,40 @@ files:
|
|
48
79
|
- Rakefile
|
49
80
|
- VERSION
|
50
81
|
- bin/restclient
|
51
|
-
- lib/rest_client.rb
|
52
82
|
- lib/rest-client.rb
|
83
|
+
- lib/rest_client.rb
|
53
84
|
- lib/restclient.rb
|
54
|
-
- lib/restclient/exceptions.rb
|
55
85
|
- lib/restclient/abstract_response.rb
|
86
|
+
- lib/restclient/exceptions.rb
|
56
87
|
- lib/restclient/net_http_ext.rb
|
57
88
|
- lib/restclient/payload.rb
|
58
89
|
- lib/restclient/raw_response.rb
|
59
90
|
- lib/restclient/request.rb
|
60
91
|
- lib/restclient/resource.rb
|
61
92
|
- lib/restclient/response.rb
|
93
|
+
- spec/abstract_response_spec.rb
|
62
94
|
- spec/base.rb
|
63
95
|
- spec/exceptions_spec.rb
|
96
|
+
- spec/integration/certs/equifax.crt
|
97
|
+
- spec/integration/certs/verisign.crt
|
98
|
+
- spec/integration/request_spec.rb
|
64
99
|
- spec/integration_spec.rb
|
65
100
|
- spec/master_shake.jpg
|
66
|
-
- spec/abstract_response_spec.rb
|
67
101
|
- spec/payload_spec.rb
|
68
102
|
- spec/raw_response_spec.rb
|
69
|
-
- spec/request_spec.rb
|
70
103
|
- spec/request2_spec.rb
|
104
|
+
- spec/request_spec.rb
|
71
105
|
- spec/resource_spec.rb
|
72
106
|
- spec/response_spec.rb
|
73
107
|
- spec/restclient_spec.rb
|
74
|
-
- spec/integration/certs/equifax.crt
|
75
|
-
- spec/integration/certs/verisign.crt
|
76
|
-
- spec/integration/request_spec.rb
|
77
108
|
- history.md
|
78
109
|
has_rdoc: true
|
79
110
|
homepage: http://github.com/archiloque/rest-client
|
80
111
|
licenses: []
|
81
112
|
|
82
113
|
post_install_message:
|
83
|
-
rdoc_options:
|
84
|
-
|
114
|
+
rdoc_options: []
|
115
|
+
|
85
116
|
require_paths:
|
86
117
|
- lib
|
87
118
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -96,29 +127,31 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
128
|
none: false
|
98
129
|
requirements:
|
99
|
-
- - "
|
130
|
+
- - ">"
|
100
131
|
- !ruby/object:Gem::Version
|
101
|
-
hash:
|
132
|
+
hash: 25
|
102
133
|
segments:
|
103
|
-
-
|
104
|
-
|
134
|
+
- 1
|
135
|
+
- 3
|
136
|
+
- 1
|
137
|
+
version: 1.3.1
|
105
138
|
requirements: []
|
106
139
|
|
107
140
|
rubyforge_project: rest-client
|
108
|
-
rubygems_version: 1.
|
141
|
+
rubygems_version: 1.5.2
|
109
142
|
signing_key:
|
110
143
|
specification_version: 3
|
111
|
-
summary: Simple REST client for Ruby, inspired by microframework syntax for specifying actions.
|
144
|
+
summary: Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.
|
112
145
|
test_files:
|
146
|
+
- spec/abstract_response_spec.rb
|
113
147
|
- spec/base.rb
|
114
148
|
- spec/exceptions_spec.rb
|
149
|
+
- spec/integration/request_spec.rb
|
115
150
|
- spec/integration_spec.rb
|
116
|
-
- spec/abstract_response_spec.rb
|
117
151
|
- spec/payload_spec.rb
|
118
152
|
- spec/raw_response_spec.rb
|
119
|
-
- spec/request_spec.rb
|
120
153
|
- spec/request2_spec.rb
|
154
|
+
- spec/request_spec.rb
|
121
155
|
- spec/resource_spec.rb
|
122
156
|
- spec/response_spec.rb
|
123
157
|
- spec/restclient_spec.rb
|
124
|
-
- spec/integration/request_spec.rb
|