flexirest 1.12.1 → 1.12.2
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.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +2 -2
- data/CHANGELOG.md +6 -0
- data/lib/flexirest/request.rb +2 -0
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/configuration_spec.rb +0 -24
- data/spec/lib/request_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7e62a7d0f69e17e808ebb5a91e63805618a5a0e9dee6fa4e1fabbbbe46c065b
|
4
|
+
data.tar.gz: e1961e477b96fac798530f5ea1dccdd55a6c1e1aca9f169f848492184d4b6820
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10a59eceb8374b68bd5b5a1556a5490ac8d1d1a125d2c64b56e78af6eebf5b54754813504bcb64e728211ee24c3f9ecc58791c3c5797517fbba0b3c45608be31
|
7
|
+
data.tar.gz: 66d9ef4f620f34c5657bf993e30020b3ceb49d5932a2340e4d7b9f3a0ed7e18082dd02e90c33907f25116df33c758b4ff425fd0fe9bf4fe90951fc2a73973c80
|
data/.github/workflows/build.yml
CHANGED
@@ -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@
|
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:
|
data/lib/flexirest/request.rb
CHANGED
data/lib/flexirest/version.rb
CHANGED
@@ -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
|
data/spec/lib/request_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2024-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|