flexirest 1.12.1 → 1.12.2

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: b36abe5b5b35c85e8705681e6ec68792c20b1ec33e44cd94420e7a49a103fb50
4
- data.tar.gz: fa2cf4caa5736b75f53b3bcf7ae61909e448ba75d58c41dfe826a92e616e42ec
3
+ metadata.gz: c7e62a7d0f69e17e808ebb5a91e63805618a5a0e9dee6fa4e1fabbbbe46c065b
4
+ data.tar.gz: e1961e477b96fac798530f5ea1dccdd55a6c1e1aca9f169f848492184d4b6820
5
5
  SHA512:
6
- metadata.gz: 6a7b314f07d529deef241d32d750770e51fe2c4fdf32390f3cbbed814d3854d2f1229f6bc138d6b1a6688f7d152ccb330a778dd05298242bae20b9790da09e46
7
- data.tar.gz: 3831f016b5b437374f2ba1a7fd9a9568077ffb71c9e1456359244055990dddb0aaf2a0fae0aa506d03bc8a8c5469ef1ae7809e3f6786e4d9b3a93d09937319a5
6
+ metadata.gz: 10a59eceb8374b68bd5b5a1556a5490ac8d1d1a125d2c64b56e78af6eebf5b54754813504bcb64e728211ee24c3f9ecc58791c3c5797517fbba0b3c45608be31
7
+ data.tar.gz: 66d9ef4f620f34c5657bf993e30020b3ceb49d5932a2340e4d7b9f3a0ed7e18082dd02e90c33907f25116df33c758b4ff425fd0fe9bf4fe90951fc2a73973c80
@@ -19,10 +19,10 @@ jobs:
19
19
  runs-on: ubuntu-latest
20
20
  strategy:
21
21
  matrix:
22
- ruby-version: ['3.0', '3.1', '3.2']
22
+ ruby-version: ['3.0', '3.1', '3.2', '3.3']
23
23
 
24
24
  steps:
25
- - uses: actions/checkout@v2
25
+ - uses: actions/checkout@v4
26
26
  - name: Set up Ruby
27
27
  uses: ruby/setup-ruby@v1
28
28
  with:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.12.2
4
+
5
+ Bugfix:
6
+
7
+ - Changing the parameters in a `defaults` option to a mapping shouldn't mutate the parameters, meaning that retries should get the same as the original parameters (thanks to vskbjrn for the bug report)
8
+
3
9
  ## 1.12.1
4
10
 
5
11
  Bugfix:
@@ -344,6 +344,8 @@ module Flexirest
344
344
  params = {id:params}
345
345
  end
346
346
 
347
+ params = params.dup
348
+
347
349
  # Format includes parameter for jsonapi
348
350
  if proxy == :json_api
349
351
  JsonAPIProxy::Request::Params.translate(params, @object._include_associations)
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.12.1"
2
+ VERSION = "1.12.2"
3
3
  end
@@ -81,18 +81,6 @@ describe Flexirest::Configuration do
81
81
  expect(SubConfigurationExample.username).to eq("john")
82
82
  end
83
83
 
84
- it "should escape the username" do
85
- Flexirest::Base.username = "bill@example.com"
86
- expect(Flexirest::Base.username).to eq("bill%40example.com")
87
- Flexirest::Base.username = nil
88
- end
89
-
90
- it "should not doubly escape the username" do
91
- Flexirest::Base.username = "bill%40example.com"
92
- expect(Flexirest::Base.username).to_not eq("bill%2540example.com")
93
- Flexirest::Base.username = nil
94
- end
95
-
96
84
  it "should remember the set password" do
97
85
  expect(ConfigurationExample.password).to eq("smith")
98
86
  end
@@ -107,18 +95,6 @@ describe Flexirest::Configuration do
107
95
  expect(SubConfigurationExample.password).to eq("smith")
108
96
  end
109
97
 
110
- it "should escape the password" do
111
- Flexirest::Base.password = "something@else"
112
- expect(Flexirest::Base.password).to eq("something%40else")
113
- Flexirest::Base.password = nil
114
- end
115
-
116
- it "should not doubly escape the password" do
117
- Flexirest::Base.password = "something%40else"
118
- expect(Flexirest::Base.password).to_not eq("something%2540else")
119
- Flexirest::Base.password = nil
120
- end
121
-
122
98
  it "should default to a form_encoded request_body_type" do
123
99
  expect(Flexirest::Base.request_body_type).to eq(:form_encoded)
124
100
  end
@@ -173,6 +173,13 @@ describe Flexirest::Request do
173
173
  get :second_call, "/second_call"
174
174
  end
175
175
 
176
+ class SimpleRetryingExampleClient < Flexirest::Base
177
+ base_url "http://www.example.com"
178
+ get :all, "/objects", defaults: proc { |params| { type: params.delete(:object_type) } }
179
+
180
+ after_request -> (name, response) { raise Flexirest::CallbackRetryRequestException.new }
181
+ end
182
+
176
183
  class LazyLoadedExampleClient < ExampleClient
177
184
  base_url "http://www.example.com"
178
185
  lazy_load!
@@ -1395,6 +1402,13 @@ describe Flexirest::Request do
1395
1402
  expect(RetryingExampleClient.retries).to eq(2)
1396
1403
  end
1397
1404
 
1405
+ it "shouldn't destructively change params before retrying" do
1406
+ stub_request(:get, "http://www.example.com/objects?type=foo").
1407
+ to_return(status: 200, body: "", headers: {})
1408
+ SimpleRetryingExampleClient.all(object_type: 'foo')
1409
+
1410
+ expect(WebMock).to have_requested(:get, "www.example.com/objects?type=foo").twice
1411
+ end
1398
1412
 
1399
1413
  context "Direct URL requests" do
1400
1414
  class SameServerExampleClient < Flexirest::Base
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexirest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler