shutl_resource 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -3
- data/Gemfile +4 -5
- data/Rakefile +2 -2
- data/lib/shutl/resource/rest_class_methods.rb +5 -1
- data/lib/shutl/resource/version.rb +1 -1
- data/lib/shutl_resource.rb +0 -1
- data/shutl_resource.gemspec +0 -5
- data/spec/request_headers_spec.rb +3 -4
- data/spec/rest_resource_spec.rb +0 -1
- data/spec/support/test_resource.rb +1 -1
- metadata +2 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 696918244a38ca0fd9a105f824662391cb2dea3b
|
4
|
+
data.tar.gz: a25d0bcfb3c94c3fca569dc527121e56078079b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a31540928199beddcf7b31033b531c04d60c96714bfaba5f186858f06caf5a593d1c0f937dcb1b42305bd530f5ae16e5415c7c2b953ff959bd4b6bb1e8827e80
|
7
|
+
data.tar.gz: 7a127180ddea91f26d56657d2403ef47493af7ed9275a544cf683763406c7a52dde2d73cc1479209c7c22f0a51fcb0c3866f050f388c5b1f382f5df2eeb5325a
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
group :development do
|
3
|
+
group :development, :test do
|
4
|
+
gem 'rake', '~> 10.0'
|
5
|
+
gem 'rspec', '~> 2.11.0'
|
6
|
+
gem 'webmock', '~> 1.8.7'
|
4
7
|
gem 'license_finder'
|
5
|
-
end
|
6
|
-
|
7
|
-
group :test do
|
8
8
|
gem 'pry'
|
9
9
|
end
|
10
|
-
# Specify your gem's dependencies in shutl_resource.gemspec
|
11
10
|
gemspec
|
data/Rakefile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'open-uri'
|
2
|
+
|
2
3
|
module Shutl::Resource
|
3
4
|
module RestClassMethods
|
4
5
|
|
@@ -20,7 +21,10 @@ module Shutl::Resource
|
|
20
21
|
end
|
21
22
|
|
22
23
|
faraday.response :json
|
23
|
-
faraday.adapter :
|
24
|
+
faraday.adapter :httpclient do |client| # yields HTTPClient
|
25
|
+
client.keep_alive_timeout = 600
|
26
|
+
client.ssl_config.timeout = 600
|
27
|
+
end
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
data/lib/shutl_resource.rb
CHANGED
data/shutl_resource.gemspec
CHANGED
@@ -26,9 +26,4 @@ Gem::Specification.new do |gem|
|
|
26
26
|
gem.add_dependency 'faraday_middleware'
|
27
27
|
gem.add_dependency 'faraday-conductivity'
|
28
28
|
gem.add_dependency 'faraday_connection_pool'
|
29
|
-
|
30
|
-
gem.add_development_dependency 'rake', '~> 10.0'
|
31
|
-
gem.add_development_dependency 'rspec', '~> 2.11.0'
|
32
|
-
|
33
|
-
gem.add_development_dependency 'webmock', '~> 1.8.7'
|
34
29
|
end
|
@@ -6,7 +6,6 @@ describe Shutl::Resource::Rest do
|
|
6
6
|
headers:
|
7
7
|
{
|
8
8
|
'Accept' => 'application/json',
|
9
|
-
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
10
9
|
'Authorization' => 'some auth',
|
11
10
|
'Content-Type' => 'application/json+consumer',
|
12
11
|
'User-Agent' => "Shutl Resource Gem v#{Shutl::Resource::VERSION}",
|
@@ -41,16 +40,16 @@ describe Shutl::Resource::Rest do
|
|
41
40
|
let(:expected_headers) {
|
42
41
|
{
|
43
42
|
'Accept' => 'application/json',
|
44
|
-
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
45
43
|
'Authorization' => 'Bearer some_auth',
|
46
44
|
'Content-Type' => 'application/json',
|
47
45
|
'User-Agent' => "Shutl Resource Gem v#{Shutl::Resource::VERSION}",
|
48
46
|
'X-Request_Id' => 'ABCDE123'
|
49
47
|
}
|
50
48
|
}
|
49
|
+
|
51
50
|
before do
|
52
51
|
@request = stub_request(:get, 'http://host/test_singular_resource')
|
53
|
-
.with(expected_headers)
|
52
|
+
.with({headers: expected_headers})
|
54
53
|
.to_return(:status => 200,
|
55
54
|
:body => '{"test_singular_resource": { "a": "a", "b": 2 }}',
|
56
55
|
:headers => response_headers)
|
@@ -180,4 +179,4 @@ describe Shutl::Resource::Rest do
|
|
180
179
|
@request.should have_been_requested
|
181
180
|
end
|
182
181
|
end
|
183
|
-
end
|
182
|
+
end
|
data/spec/rest_resource_spec.rb
CHANGED
@@ -341,7 +341,6 @@ describe Shutl::Resource::Rest do
|
|
341
341
|
with(:headers => {
|
342
342
|
'Authorization'=>'Bearer TOKEN',
|
343
343
|
'Accept'=>'application/json',
|
344
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
345
344
|
'Content-Type'=>'application/json',
|
346
345
|
'User-Agent'=>"Shutl Resource Gem v#{Shutl::Resource::VERSION}"}).
|
347
346
|
to_return(:status => 200, :body => '{"test_rests": [{ "a": "a", "b": 2 }]}', :headers => {})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shutl_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rouchy
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2017-01-
|
16
|
+
date: 2017-01-24 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: shutl_auth
|
@@ -99,48 +99,6 @@ dependencies:
|
|
99
99
|
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
|
-
- !ruby/object:Gem::Dependency
|
103
|
-
name: rake
|
104
|
-
requirement: !ruby/object:Gem::Requirement
|
105
|
-
requirements:
|
106
|
-
- - "~>"
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: '10.0'
|
109
|
-
type: :development
|
110
|
-
prerelease: false
|
111
|
-
version_requirements: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
- - "~>"
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: '10.0'
|
116
|
-
- !ruby/object:Gem::Dependency
|
117
|
-
name: rspec
|
118
|
-
requirement: !ruby/object:Gem::Requirement
|
119
|
-
requirements:
|
120
|
-
- - "~>"
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: 2.11.0
|
123
|
-
type: :development
|
124
|
-
prerelease: false
|
125
|
-
version_requirements: !ruby/object:Gem::Requirement
|
126
|
-
requirements:
|
127
|
-
- - "~>"
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: 2.11.0
|
130
|
-
- !ruby/object:Gem::Dependency
|
131
|
-
name: webmock
|
132
|
-
requirement: !ruby/object:Gem::Requirement
|
133
|
-
requirements:
|
134
|
-
- - "~>"
|
135
|
-
- !ruby/object:Gem::Version
|
136
|
-
version: 1.8.7
|
137
|
-
type: :development
|
138
|
-
prerelease: false
|
139
|
-
version_requirements: !ruby/object:Gem::Requirement
|
140
|
-
requirements:
|
141
|
-
- - "~>"
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
version: 1.8.7
|
144
102
|
description: Shutl Rest resource
|
145
103
|
email:
|
146
104
|
- davidr@shutl.co.uk
|