httparty 0.10.0 → 0.14.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.
Potentially problematic release.
This version of httparty might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +92 -0
- data/.rubocop_todo.yml +124 -0
- data/.simplecov +1 -0
- data/.travis.yml +5 -4
- data/CONTRIBUTING.md +23 -0
- data/Gemfile +9 -5
- data/Guardfile +3 -3
- data/History +109 -8
- data/README.md +21 -21
- data/Rakefile +5 -10
- data/bin/httparty +21 -14
- data/docs/README.md +100 -0
- data/examples/README.md +67 -0
- data/examples/aaws.rb +9 -9
- data/examples/basic.rb +6 -10
- data/examples/crack.rb +3 -3
- data/examples/custom_parsers.rb +1 -4
- data/examples/delicious.rb +12 -12
- data/examples/google.rb +2 -2
- data/examples/headers_and_user_agents.rb +2 -2
- data/examples/logging.rb +36 -0
- data/examples/nokogiri_html_parser.rb +0 -3
- data/examples/rescue_json.rb +17 -0
- data/examples/rubyurl.rb +3 -3
- data/examples/stackexchange.rb +24 -0
- data/examples/tripit_sign_in.rb +20 -9
- data/examples/twitter.rb +11 -11
- data/examples/whoismyrep.rb +2 -2
- data/features/command_line.feature +90 -2
- data/features/digest_authentication.feature +10 -0
- data/features/handles_compressed_responses.feature +8 -0
- data/features/handles_multiple_formats.feature +23 -0
- data/features/steps/env.rb +16 -11
- data/features/steps/httparty_response_steps.rb +40 -10
- data/features/steps/httparty_steps.rb +19 -3
- data/features/steps/mongrel_helper.rb +35 -2
- data/features/steps/remote_service_steps.rb +31 -8
- data/features/supports_read_timeout_option.feature +13 -0
- data/httparty.gemspec +9 -6
- data/lib/httparty/connection_adapter.rb +76 -11
- data/lib/httparty/cookie_hash.rb +3 -4
- data/lib/httparty/exceptions.rb +10 -4
- data/lib/httparty/hash_conversions.rb +19 -17
- data/lib/httparty/logger/apache_formatter.rb +22 -0
- data/lib/httparty/logger/curl_formatter.rb +91 -0
- data/lib/httparty/logger/logger.rb +26 -0
- data/lib/httparty/module_inheritable_attributes.rb +1 -1
- data/lib/httparty/net_digest_auth.rb +69 -18
- data/lib/httparty/parser.rb +15 -11
- data/lib/httparty/request.rb +186 -47
- data/lib/httparty/response/headers.rb +2 -2
- data/lib/httparty/response.rb +44 -9
- data/lib/httparty/version.rb +1 -1
- data/lib/httparty.rb +187 -65
- data/script/release +42 -0
- data/spec/fixtures/twitter.csv +2 -0
- data/spec/httparty/connection_adapter_spec.rb +334 -62
- data/spec/httparty/cookie_hash_spec.rb +53 -23
- data/spec/httparty/exception_spec.rb +45 -0
- data/spec/httparty/hash_conversions_spec.rb +49 -0
- data/spec/httparty/logger/apache_formatter_spec.rb +41 -0
- data/spec/httparty/logger/curl_formatter_spec.rb +119 -0
- data/spec/httparty/logger/logger_spec.rb +38 -0
- data/spec/httparty/net_digest_auth_spec.rb +148 -23
- data/spec/httparty/parser_spec.rb +48 -41
- data/spec/httparty/request_spec.rb +845 -151
- data/spec/httparty/response_spec.rb +147 -70
- data/spec/httparty/ssl_spec.rb +33 -21
- data/spec/httparty_spec.rb +337 -186
- data/spec/spec_helper.rb +38 -9
- data/spec/support/ssl_test_helper.rb +10 -10
- data/spec/support/ssl_test_server.rb +21 -21
- data/spec/support/stub_response.rb +20 -14
- data/website/index.html +3 -3
- metadata +46 -37
- data/lib/httparty/core_extensions.rb +0 -32
- data/spec/spec.opts +0 -2
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require "simplecov"
|
2
|
+
SimpleCov.start
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
4
|
+
require "httparty"
|
5
|
+
require "fakeweb"
|
6
6
|
|
7
7
|
def file_fixture(filename)
|
8
|
-
open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename
|
8
|
+
open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename}")).read
|
9
9
|
end
|
10
10
|
|
11
|
-
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
|
11
|
+
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support', '**', '*.rb'))].each {|f| require f}
|
12
12
|
|
13
|
-
|
13
|
+
RSpec.configure do |config|
|
14
14
|
config.include HTTParty::StubResponse
|
15
15
|
config.include HTTParty::SSLTestHelper
|
16
16
|
|
@@ -21,10 +21,39 @@ Spec::Runner.configure do |config|
|
|
21
21
|
config.after(:suite) do
|
22
22
|
FakeWeb.allow_net_connect = true
|
23
23
|
end
|
24
|
+
|
25
|
+
config.expect_with :rspec do |expectations|
|
26
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
27
|
+
end
|
28
|
+
|
29
|
+
config.mock_with :rspec do |mocks|
|
30
|
+
mocks.verify_partial_doubles = false
|
31
|
+
end
|
32
|
+
|
33
|
+
config.filter_run :focus
|
34
|
+
config.run_all_when_everything_filtered = true
|
35
|
+
|
36
|
+
config.disable_monkey_patching!
|
37
|
+
|
38
|
+
config.warnings = true
|
39
|
+
|
40
|
+
if config.files_to_run.one?
|
41
|
+
config.default_formatter = 'doc'
|
42
|
+
end
|
43
|
+
|
44
|
+
config.profile_examples = 10
|
45
|
+
|
46
|
+
config.order = :random
|
47
|
+
|
48
|
+
Kernel.srand config.seed
|
49
|
+
end
|
50
|
+
|
51
|
+
RSpec::Matchers.define :use_ssl do
|
52
|
+
match(&:use_ssl?)
|
24
53
|
end
|
25
54
|
|
26
|
-
|
55
|
+
RSpec::Matchers.define :use_cert_store do |cert_store|
|
27
56
|
match do |connection|
|
28
|
-
connection.
|
57
|
+
connection.cert_store == cert_store
|
29
58
|
end
|
30
59
|
end
|
@@ -2,11 +2,11 @@ require 'pathname'
|
|
2
2
|
|
3
3
|
module HTTParty
|
4
4
|
module SSLTestHelper
|
5
|
-
def ssl_verify_test(mode, ca_basename, server_cert_filename)
|
5
|
+
def ssl_verify_test(mode, ca_basename, server_cert_filename, options = {})
|
6
6
|
options = {
|
7
|
-
:
|
8
|
-
:
|
9
|
-
}
|
7
|
+
format: :json,
|
8
|
+
timeout: 30
|
9
|
+
}.merge(options)
|
10
10
|
|
11
11
|
if mode
|
12
12
|
ca_path = File.expand_path("../../fixtures/ssl/generated/#{ca_basename}", __FILE__)
|
@@ -16,25 +16,25 @@ module HTTParty
|
|
16
16
|
|
17
17
|
begin
|
18
18
|
test_server = SSLTestServer.new(
|
19
|
-
:
|
20
|
-
:
|
19
|
+
rsa_key: File.read(File.expand_path("../../fixtures/ssl/generated/server.key", __FILE__)),
|
20
|
+
cert: File.read(File.expand_path("../../fixtures/ssl/generated/#{server_cert_filename}", __FILE__)))
|
21
21
|
|
22
22
|
test_server.start
|
23
23
|
|
24
24
|
if mode
|
25
25
|
ca_path = File.expand_path("../../fixtures/ssl/generated/#{ca_basename}", __FILE__)
|
26
26
|
raise ArgumentError.new("#{ca_path} does not exist") unless File.exist?(ca_path)
|
27
|
-
return HTTParty.get("https://localhost:#{test_server.port}/",
|
27
|
+
return HTTParty.get("https://localhost:#{test_server.port}/", options)
|
28
28
|
else
|
29
|
-
return HTTParty.get("https://localhost:#{test_server.port}/",
|
29
|
+
return HTTParty.get("https://localhost:#{test_server.port}/", options)
|
30
30
|
end
|
31
31
|
ensure
|
32
32
|
test_server.stop if test_server
|
33
33
|
end
|
34
34
|
|
35
35
|
test_server = SSLTestServer.new({
|
36
|
-
:
|
37
|
-
:
|
36
|
+
rsa_key: path.join('server.key').read,
|
37
|
+
cert: path.join(server_cert_filename).read
|
38
38
|
})
|
39
39
|
|
40
40
|
test_server.start
|
@@ -9,7 +9,7 @@ class SSLTestServer
|
|
9
9
|
attr_accessor :ctx # SSLContext object
|
10
10
|
attr_reader :port
|
11
11
|
|
12
|
-
def initialize(options={})
|
12
|
+
def initialize(options = {})
|
13
13
|
@ctx = OpenSSL::SSL::SSLContext.new
|
14
14
|
@ctx.cert = OpenSSL::X509::Certificate.new(options[:cert])
|
15
15
|
@ctx.key = OpenSSL::PKey::RSA.new(options[:rsa_key])
|
@@ -24,21 +24,21 @@ class SSLTestServer
|
|
24
24
|
@raw_server = TCPServer.new(@port)
|
25
25
|
|
26
26
|
if @port == 0
|
27
|
-
@port = Socket
|
27
|
+
@port = Socket.getnameinfo(@raw_server.getsockname, Socket::NI_NUMERICHOST | Socket::NI_NUMERICSERV)[1].to_i
|
28
28
|
end
|
29
29
|
|
30
30
|
@ssl_server = OpenSSL::SSL::SSLServer.new(@raw_server, @ctx)
|
31
31
|
|
32
|
-
@stopping_mutex.synchronize{
|
32
|
+
@stopping_mutex.synchronize {
|
33
33
|
return if @stopping
|
34
|
-
@thread = Thread.new{ thread_main }
|
34
|
+
@thread = Thread.new { thread_main }
|
35
35
|
}
|
36
36
|
|
37
37
|
nil
|
38
38
|
end
|
39
39
|
|
40
40
|
def stop
|
41
|
-
@stopping_mutex.synchronize{
|
41
|
+
@stopping_mutex.synchronize {
|
42
42
|
return if @stopping
|
43
43
|
@stopping = true
|
44
44
|
}
|
@@ -47,22 +47,22 @@ class SSLTestServer
|
|
47
47
|
|
48
48
|
private
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
def thread_main
|
51
|
+
until @stopping_mutex.synchronize { @stopping }
|
52
|
+
(rr, _, _) = select([@ssl_server.to_io], nil, nil, 0.1)
|
53
53
|
|
54
|
-
|
54
|
+
next unless rr && rr.include?(@ssl_server.to_io)
|
55
55
|
|
56
|
-
|
56
|
+
socket = @ssl_server.accept
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
Thread.new {
|
59
|
+
header = []
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
until (line = socket.readline).rstrip.empty?
|
62
|
+
header << line
|
63
|
+
end
|
64
64
|
|
65
|
-
|
65
|
+
response = <<EOF
|
66
66
|
HTTP/1.1 200 OK
|
67
67
|
Connection: close
|
68
68
|
Content-Type: application/json; charset=UTF-8
|
@@ -70,11 +70,11 @@ Content-Type: application/json; charset=UTF-8
|
|
70
70
|
{"success":true}
|
71
71
|
EOF
|
72
72
|
|
73
|
-
|
74
|
-
|
73
|
+
socket.write(response.gsub(/\r\n/n, "\n").gsub(/\n/n, "\r\n"))
|
74
|
+
socket.close
|
75
75
|
}
|
76
|
-
end
|
77
|
-
|
78
|
-
@ssl_server.close
|
79
76
|
end
|
77
|
+
|
78
|
+
@ssl_server.close
|
79
|
+
end
|
80
80
|
end
|
@@ -5,38 +5,44 @@ module HTTParty
|
|
5
5
|
data = file_fixture(filename)
|
6
6
|
|
7
7
|
response = Net::HTTPOK.new("1.1", 200, "Content for you")
|
8
|
-
response.
|
8
|
+
allow(response).to receive(:body).and_return(data)
|
9
9
|
|
10
|
-
http_request = HTTParty::Request.new(Net::HTTP::Get, 'http://localhost', :
|
11
|
-
http_request.
|
10
|
+
http_request = HTTParty::Request.new(Net::HTTP::Get, 'http://localhost', format: format)
|
11
|
+
allow(http_request).to receive_message_chain(:http, :request).and_return(response)
|
12
12
|
|
13
|
-
HTTParty::Request.
|
13
|
+
expect(HTTParty::Request).to receive(:new).and_return(http_request)
|
14
14
|
end
|
15
15
|
|
16
|
-
def stub_chunked_http_response_with(chunks)
|
16
|
+
def stub_chunked_http_response_with(chunks, options = {format: "html"})
|
17
17
|
response = Net::HTTPResponse.new("1.1", 200, nil)
|
18
|
-
response.
|
18
|
+
allow(response).to receive(:chunked_data).and_return(chunks)
|
19
19
|
def response.read_body(&block)
|
20
20
|
@body || chunked_data.each(&block)
|
21
21
|
end
|
22
22
|
|
23
|
-
http_request = HTTParty::Request.new(Net::HTTP::Get, 'http://localhost',
|
24
|
-
http_request.
|
23
|
+
http_request = HTTParty::Request.new(Net::HTTP::Get, 'http://localhost', options)
|
24
|
+
allow(http_request).to receive_message_chain(:http, :request).and_yield(response).and_return(response)
|
25
25
|
|
26
|
-
HTTParty::Request.
|
26
|
+
expect(HTTParty::Request).to receive(:new).and_return(http_request)
|
27
27
|
end
|
28
28
|
|
29
|
-
def stub_response(body, code = 200)
|
29
|
+
def stub_response(body, code = '200')
|
30
|
+
code = code.to_s
|
30
31
|
@request.options[:base_uri] ||= 'http://localhost'
|
31
32
|
unless defined?(@http) && @http
|
32
33
|
@http = Net::HTTP.new('localhost', 80)
|
33
|
-
@request.
|
34
|
+
allow(@request).to receive(:http).and_return(@http)
|
34
35
|
end
|
35
36
|
|
36
|
-
|
37
|
-
|
37
|
+
# CODE_TO_OBJ currently missing 308
|
38
|
+
if code == '308'
|
39
|
+
response = Net::HTTPRedirection.new("1.1", code, body)
|
40
|
+
else
|
41
|
+
response = Net::HTTPResponse::CODE_TO_OBJ[code].new("1.1", code, body)
|
42
|
+
end
|
43
|
+
allow(response).to receive(:body).and_return(body)
|
38
44
|
|
39
|
-
@http.
|
45
|
+
allow(@http).to receive(:request).and_return(response)
|
40
46
|
response
|
41
47
|
end
|
42
48
|
end
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
basic_auth 'username', 'password'
|
34
34
|
end
|
35
35
|
|
36
|
-
Twitter.post('/statuses/update.json', :
|
36
|
+
Twitter.post('/statuses/update.json', query: {status: "It's an HTTParty and everyone is invited!"})</code></pre>
|
37
37
|
|
38
38
|
<p>That is really it! The object returned is a ruby hash that is decoded from Twitter's json response. JSON parsing is used because of the .json extension in the path of the request. You can also explicitly set a format (see the examples). </p>
|
39
39
|
|
@@ -44,11 +44,11 @@ Twitter.post('/statuses/update.json', :query => {:status => "It's an HTTParty an
|
|
44
44
|
base_uri 'twitter.com'
|
45
45
|
|
46
46
|
def initialize(u, p)
|
47
|
-
@auth = {:
|
47
|
+
@auth = {username: u, password: p}
|
48
48
|
end
|
49
49
|
|
50
50
|
def post(text)
|
51
|
-
options = { :
|
51
|
+
options = { query: {status: text}, basic_auth: @auth }
|
52
52
|
self.class.post('/statuses/update.json', options)
|
53
53
|
end
|
54
54
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.14.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- John Nunemaker
|
@@ -10,30 +9,22 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
-
requirement:
|
18
|
-
none: false
|
15
|
+
name: multi_xml
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - ">="
|
21
19
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
20
|
+
version: 0.5.2
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
|
-
version_requirements:
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: multi_xml
|
28
|
-
requirement: &70244756914000 !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
24
|
requirements:
|
31
|
-
- -
|
25
|
+
- - ">="
|
32
26
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: *70244756914000
|
27
|
+
version: 0.5.2
|
37
28
|
description: Makes http fun! Also, makes consuming restful web services dead easy.
|
38
29
|
email:
|
39
30
|
- nunemaker@gmail.com
|
@@ -42,8 +33,12 @@ executables:
|
|
42
33
|
extensions: []
|
43
34
|
extra_rdoc_files: []
|
44
35
|
files:
|
45
|
-
- .gitignore
|
46
|
-
- .
|
36
|
+
- ".gitignore"
|
37
|
+
- ".rubocop.yml"
|
38
|
+
- ".rubocop_todo.yml"
|
39
|
+
- ".simplecov"
|
40
|
+
- ".travis.yml"
|
41
|
+
- CONTRIBUTING.md
|
47
42
|
- Gemfile
|
48
43
|
- Guardfile
|
49
44
|
- History
|
@@ -52,6 +47,8 @@ files:
|
|
52
47
|
- Rakefile
|
53
48
|
- bin/httparty
|
54
49
|
- cucumber.yml
|
50
|
+
- docs/README.md
|
51
|
+
- examples/README.md
|
55
52
|
- examples/aaws.rb
|
56
53
|
- examples/basic.rb
|
57
54
|
- examples/crack.rb
|
@@ -59,8 +56,11 @@ files:
|
|
59
56
|
- examples/delicious.rb
|
60
57
|
- examples/google.rb
|
61
58
|
- examples/headers_and_user_agents.rb
|
59
|
+
- examples/logging.rb
|
62
60
|
- examples/nokogiri_html_parser.rb
|
61
|
+
- examples/rescue_json.rb
|
63
62
|
- examples/rubyurl.rb
|
63
|
+
- examples/stackexchange.rb
|
64
64
|
- examples/tripit_sign_in.rb
|
65
65
|
- examples/twitter.rb
|
66
66
|
- examples/whoismyrep.rb
|
@@ -75,15 +75,18 @@ files:
|
|
75
75
|
- features/steps/httparty_steps.rb
|
76
76
|
- features/steps/mongrel_helper.rb
|
77
77
|
- features/steps/remote_service_steps.rb
|
78
|
+
- features/supports_read_timeout_option.feature
|
78
79
|
- features/supports_redirection.feature
|
79
80
|
- features/supports_timeout_option.feature
|
80
81
|
- httparty.gemspec
|
81
82
|
- lib/httparty.rb
|
82
83
|
- lib/httparty/connection_adapter.rb
|
83
84
|
- lib/httparty/cookie_hash.rb
|
84
|
-
- lib/httparty/core_extensions.rb
|
85
85
|
- lib/httparty/exceptions.rb
|
86
86
|
- lib/httparty/hash_conversions.rb
|
87
|
+
- lib/httparty/logger/apache_formatter.rb
|
88
|
+
- lib/httparty/logger/curl_formatter.rb
|
89
|
+
- lib/httparty/logger/logger.rb
|
87
90
|
- lib/httparty/module_inheritable_attributes.rb
|
88
91
|
- lib/httparty/net_digest_auth.rb
|
89
92
|
- lib/httparty/parser.rb
|
@@ -91,6 +94,7 @@ files:
|
|
91
94
|
- lib/httparty/response.rb
|
92
95
|
- lib/httparty/response/headers.rb
|
93
96
|
- lib/httparty/version.rb
|
97
|
+
- script/release
|
94
98
|
- spec/fixtures/delicious.xml
|
95
99
|
- spec/fixtures/empty.xml
|
96
100
|
- spec/fixtures/google.html
|
@@ -103,18 +107,23 @@ files:
|
|
103
107
|
- spec/fixtures/ssl/generated/server.crt
|
104
108
|
- spec/fixtures/ssl/generated/server.key
|
105
109
|
- spec/fixtures/ssl/openssl-exts.cnf
|
110
|
+
- spec/fixtures/twitter.csv
|
106
111
|
- spec/fixtures/twitter.json
|
107
112
|
- spec/fixtures/twitter.xml
|
108
113
|
- spec/fixtures/undefined_method_add_node_for_nil.xml
|
109
114
|
- spec/httparty/connection_adapter_spec.rb
|
110
115
|
- spec/httparty/cookie_hash_spec.rb
|
116
|
+
- spec/httparty/exception_spec.rb
|
117
|
+
- spec/httparty/hash_conversions_spec.rb
|
118
|
+
- spec/httparty/logger/apache_formatter_spec.rb
|
119
|
+
- spec/httparty/logger/curl_formatter_spec.rb
|
120
|
+
- spec/httparty/logger/logger_spec.rb
|
111
121
|
- spec/httparty/net_digest_auth_spec.rb
|
112
122
|
- spec/httparty/parser_spec.rb
|
113
123
|
- spec/httparty/request_spec.rb
|
114
124
|
- spec/httparty/response_spec.rb
|
115
125
|
- spec/httparty/ssl_spec.rb
|
116
126
|
- spec/httparty_spec.rb
|
117
|
-
- spec/spec.opts
|
118
127
|
- spec/spec_helper.rb
|
119
128
|
- spec/support/ssl_test_helper.rb
|
120
129
|
- spec/support/ssl_test_server.rb
|
@@ -122,34 +131,28 @@ files:
|
|
122
131
|
- website/css/common.css
|
123
132
|
- website/index.html
|
124
133
|
homepage: http://jnunemaker.github.com/httparty
|
125
|
-
licenses:
|
134
|
+
licenses:
|
135
|
+
- MIT
|
136
|
+
metadata: {}
|
126
137
|
post_install_message: When you HTTParty, you must party hard!
|
127
138
|
rdoc_options: []
|
128
139
|
require_paths:
|
129
140
|
- lib
|
130
141
|
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
142
|
requirements:
|
133
|
-
- -
|
143
|
+
- - ">="
|
134
144
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
136
|
-
segments:
|
137
|
-
- 0
|
138
|
-
hash: -707685205189815714
|
145
|
+
version: 1.9.3
|
139
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
147
|
requirements:
|
142
|
-
- -
|
148
|
+
- - ">="
|
143
149
|
- !ruby/object:Gem::Version
|
144
150
|
version: '0'
|
145
|
-
segments:
|
146
|
-
- 0
|
147
|
-
hash: -707685205189815714
|
148
151
|
requirements: []
|
149
152
|
rubyforge_project:
|
150
|
-
rubygems_version:
|
153
|
+
rubygems_version: 2.4.5.1
|
151
154
|
signing_key:
|
152
|
-
specification_version:
|
155
|
+
specification_version: 4
|
153
156
|
summary: Makes http fun! Also, makes consuming restful web services dead easy.
|
154
157
|
test_files:
|
155
158
|
- features/basic_authentication.feature
|
@@ -163,6 +166,7 @@ test_files:
|
|
163
166
|
- features/steps/httparty_steps.rb
|
164
167
|
- features/steps/mongrel_helper.rb
|
165
168
|
- features/steps/remote_service_steps.rb
|
169
|
+
- features/supports_read_timeout_option.feature
|
166
170
|
- features/supports_redirection.feature
|
167
171
|
- features/supports_timeout_option.feature
|
168
172
|
- spec/fixtures/delicious.xml
|
@@ -177,18 +181,23 @@ test_files:
|
|
177
181
|
- spec/fixtures/ssl/generated/server.crt
|
178
182
|
- spec/fixtures/ssl/generated/server.key
|
179
183
|
- spec/fixtures/ssl/openssl-exts.cnf
|
184
|
+
- spec/fixtures/twitter.csv
|
180
185
|
- spec/fixtures/twitter.json
|
181
186
|
- spec/fixtures/twitter.xml
|
182
187
|
- spec/fixtures/undefined_method_add_node_for_nil.xml
|
183
188
|
- spec/httparty/connection_adapter_spec.rb
|
184
189
|
- spec/httparty/cookie_hash_spec.rb
|
190
|
+
- spec/httparty/exception_spec.rb
|
191
|
+
- spec/httparty/hash_conversions_spec.rb
|
192
|
+
- spec/httparty/logger/apache_formatter_spec.rb
|
193
|
+
- spec/httparty/logger/curl_formatter_spec.rb
|
194
|
+
- spec/httparty/logger/logger_spec.rb
|
185
195
|
- spec/httparty/net_digest_auth_spec.rb
|
186
196
|
- spec/httparty/parser_spec.rb
|
187
197
|
- spec/httparty/request_spec.rb
|
188
198
|
- spec/httparty/response_spec.rb
|
189
199
|
- spec/httparty/ssl_spec.rb
|
190
200
|
- spec/httparty_spec.rb
|
191
|
-
- spec/spec.opts
|
192
201
|
- spec/spec_helper.rb
|
193
202
|
- spec/support/ssl_test_helper.rb
|
194
203
|
- spec/support/ssl_test_server.rb
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module HTTParty
|
2
|
-
if defined?(::BasicObject)
|
3
|
-
BasicObject = ::BasicObject #:nodoc:
|
4
|
-
else
|
5
|
-
class BasicObject #:nodoc:
|
6
|
-
instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval/ }
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
unless defined?(Net::HTTP::Patch)
|
11
|
-
class Net::HTTP
|
12
|
-
def patch(path, data, initheader = nil, dest = nil, &block) #:nodoc:
|
13
|
-
res = nil
|
14
|
-
request(Patch.new(path, initheader), data) {|r|
|
15
|
-
r.read_body dest, &block
|
16
|
-
res = r
|
17
|
-
}
|
18
|
-
unless @newimpl
|
19
|
-
res.value
|
20
|
-
return res, res.body
|
21
|
-
end
|
22
|
-
res
|
23
|
-
end
|
24
|
-
|
25
|
-
class Patch < Net::HTTPRequest
|
26
|
-
METHOD = 'PATCH'
|
27
|
-
REQUEST_HAS_BODY = true
|
28
|
-
RESPONSE_HAS_BODY = true
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
data/spec/spec.opts
DELETED