reso_transport 1.5.17 → 1.5.19

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
  SHA256:
3
- metadata.gz: 0f3af2238c99c5189f1c1ef69014dcc14c0b85737c9ebb10a11d799fdc5d990b
4
- data.tar.gz: af63936ad3613495d3593b8f1b1e35e7240f53a0350feb04d223e5b2635f68f3
3
+ metadata.gz: ff26d270c5202a27d5df7a52dc122c1790c017cdf6e7547830fa7386d9996ec7
4
+ data.tar.gz: b4bacea38b43b18ab14989219ab0c0f8d3c0e9587a6a9ff539be2c8b6f05d355
5
5
  SHA512:
6
- metadata.gz: a95642fb614be818f6567dbc178e83014c8c554a2a8efb7ae177c0ddd22ec6ff0107ac324b5817ea583c477287c49e2e2195364043fb38d2efb2eb2c3cb05ebe
7
- data.tar.gz: 02e335cecfbcd42663f4cba338c7156a23ecc2809646684503d4a0f3f3559555da56f1f3158a809e2434e73b505be247e6c3d5d57858e7f9f44d76e89dd7eb6e
6
+ metadata.gz: 7d8cd7b433014eebe9cb4e5d703d32891f57b75ab510c8d80e0126aa6b676d02fdcc11d779f8a44f9657b0a18402ecea1074f7b1ca874a1d760d1008a010dd1a
7
+ data.tar.gz: b634920adeb8f9367ca38437137b1976ad96c549995a91fed47593a673519b45febffcf84922925d721d8ff57a2d322a8d5910d184e6d08ce6a76a2aaf9d058e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reso_transport (1.5.17)
4
+ reso_transport (1.5.19)
5
5
  faraday (~> 1.0.1)
6
6
 
7
7
  GEM
@@ -80,17 +80,26 @@ module ResoTransport
80
80
  resource.parse(results)
81
81
  end
82
82
 
83
- # Can only be accessed after results call
83
+ # Can only be accessed after results call or if it's being set
84
84
  def next_link
85
85
  @next_link
86
86
  end
87
87
 
88
+ # used for setting the next_link with trestle's replication strategy
89
+ def next_link=(link)
90
+ @next_link = link
91
+ end
92
+
88
93
  def response
89
- resource.get(compile_params)
94
+ use_next_link? ? resource.get_next_link_results(next_link) : resource.get(compile_params)
90
95
  rescue Faraday::ConnectionFailed
91
96
  raise NoResponse.new(resource.request, nil, resource)
92
97
  end
93
98
 
99
+ def use_next_link?
100
+ compile_params[:replication] && next_link.present?
101
+ end
102
+
94
103
  def handle_response(response)
95
104
  raise RequestError.new(resource.request, response, resource) unless response.success?
96
105
 
@@ -43,6 +43,13 @@ module ResoTransport
43
43
  end
44
44
  end
45
45
 
46
+ def get_next_link_results(next_link)
47
+ client.connection.get(next_link) do |req|
48
+ req.headers['Accept'] = 'application/json'
49
+ @request = req
50
+ end
51
+ end
52
+
46
53
  def url
47
54
  return local['ResourcePath'].gsub(%r{^/}, '') if local
48
55
 
@@ -1,3 +1,3 @@
1
1
  module ResoTransport
2
- VERSION = '1.5.17'.freeze
2
+ VERSION = '1.5.19'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reso_transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.17
4
+ version: 1.5.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Druse
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-14 00:00:00.000000000 Z
11
+ date: 2022-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday