restful_resource 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d294661eeac9255891b66e6dbebb6f1f5da44921
4
- data.tar.gz: 5859ac65ef925dbd3c92b310ab377f8b3247258b
3
+ metadata.gz: d2d72ef667a20e5c2773931c3b5c449af79ed096
4
+ data.tar.gz: f0d464e0d0ffd5740c61d5ae6e251e755844e940
5
5
  SHA512:
6
- metadata.gz: 49e2eb64d13010ced65c8a1d0b7b18d61047cfb7afd9d9afaced84453975a8b8317161cd5ea038413750e777ef7bc93acd916e82b6ed088507f0bb03695c23aa
7
- data.tar.gz: 590deacd3e072ec8bb49cbe2e5e5d479d7442e7ad45cc9ba6e108af080434a7ec2dd716badf6d1dc0c3019fcd77540eea4298ac593e3db5d0c3b140d28e6eb09
6
+ metadata.gz: 161b0138fea97c3cb5853514ddc3b799328bf01d8829276b84f1dadcd2b1513739f2a8a7163a35c54304c1549e184dd0d3d1731920b4c16e41e859fadbeb61fe
7
+ data.tar.gz: 40177d79fd2a410a23adbb5e93037b72fc82657f7d9caa1353cc318aa296984fd1e862d5a11eb3ca8ea45b1d1d3320332146777b5b75d419cc5d387105272304
data/Rakefile CHANGED
@@ -9,12 +9,12 @@ desc "Upload to rubygems"
9
9
  task :upload => :build do
10
10
  # Check if tag with v#{ResearchSiteApiClient::VERSION} version exists, if so, return with error
11
11
 
12
- # if tag_exists?(current_tag_name)
13
- # puts "Tag exists, did you run rake increase_revision_number after merging with master?"
14
- # exit 1
15
- # end
12
+ if tag_exists?(current_tag_name)
13
+ puts "Tag exists, did you run rake increase_revision_number after merging with master?"
14
+ exit 1
15
+ end
16
16
 
17
- # create_tag(current_tag_name)
17
+ create_tag(current_tag_name)
18
18
  Rake::Task[:release].invoke
19
19
  end
20
20
 
@@ -1,3 +1,6 @@
1
+ # Use the Faraday-Typhoeus adapter provided by Typhoeus, not Faraday
2
+ require "typhoeus/adapters/faraday"
3
+
1
4
  module RestfulResource
2
5
  class HttpClient
3
6
  class HttpError < StandardError
@@ -86,17 +89,15 @@ module RestfulResource
86
89
  b.response :encoding
87
90
  b.use :gzip
88
91
 
89
- b.adapter :excon,
90
- nonblock: true, # Always use non-blocking IO (for safe timeouts)
91
- persistent: true, # Re-use TCP connections
92
- connect_timeout: 2, # seconds
93
- read_timeout: 10, # seconds
94
- write_timeout: 2 # seconds
92
+ b.adapter :typhoeus
95
93
  end
96
94
  end
97
95
 
98
96
  def http_request(request)
99
97
  response = @connection.send(request.method) do |req|
98
+ req.options.open_timeout = 2 # seconds
99
+ req.options.timeout = 10 # seconds
100
+
100
101
  req.body = request.body unless request.body.nil?
101
102
  req.url request.url
102
103
 
@@ -1,3 +1,3 @@
1
1
  module RestfulResource
2
- VERSION = '1.2.2'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "link_header"
31
31
  spec.add_dependency "activesupport"
32
32
  spec.add_dependency "rack"
33
- spec.add_dependency "excon"
33
+ spec.add_dependency "typhoeus"
34
34
  end
@@ -20,8 +20,8 @@ describe RestfulResource::HttpClient do
20
20
  let(:middleware) { connection.builder.handlers }
21
21
 
22
22
  describe 'Builder configuration' do
23
- it 'uses the excon adapter' do
24
- expect(middleware).to include Faraday::Adapter::Excon
23
+ it 'uses the typhoeus adapter' do
24
+ expect(middleware).to include Faraday::Adapter::Typhoeus
25
25
  end
26
26
 
27
27
  it 'url_encodes requests' do
@@ -65,29 +65,5 @@ describe RestfulResource::HttpClient do
65
65
  end
66
66
  end
67
67
  end
68
-
69
- describe 'Excon Adapter configuration' do
70
- let(:config) { find_middleware_args connection, 'Faraday::Adapter::Excon' }
71
-
72
- it 'uses nonblock' do
73
- expect(config[:nonblock]).to eq true
74
- end
75
-
76
- it 'uses a persistent connection' do
77
- expect(config[:persistent]).to eq true
78
- end
79
-
80
- it 'has a connect_timeout of 2' do
81
- expect(config[:connect_timeout]).to eq 2
82
- end
83
-
84
- it 'has a read_timeout of 10' do
85
- expect(config[:read_timeout]).to eq 10
86
- end
87
-
88
- it 'has a write_timeout of 2' do
89
- expect(config[:write_timeout]).to eq 2
90
- end
91
- end
92
68
  end
93
- end
69
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santoro
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-19 00:00:00.000000000 Z
12
+ date: 2016-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -152,7 +152,7 @@ dependencies:
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  - !ruby/object:Gem::Dependency
155
- name: excon
155
+ name: typhoeus
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="