gibbon 4.1.0 → 4.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 436a4854363f5450432eba62cf6dc7c214872eda807d2da8c6a26189898c39dd
4
- data.tar.gz: cf8885a3ced45944a4857b72c3b5361bd9a3529e2b5314884307b9b6b98edff0
3
+ metadata.gz: 03c53ed2d53ab67b1eb57e172b588844a8f58933e42b0e1ec082d89fe2c3f5fa
4
+ data.tar.gz: 96dd6b830075c0abf1e2d22d9937ccc99aba546c8168cbc0e35a72da2bc98334
5
5
  SHA512:
6
- metadata.gz: dc714f8a5d5782b42fbafd96c88b3e09922a3fb12ce07d3689365ceb71b84f86baa40be5ae5a5743f130128092b3cf0e0f81498f0ea05a1e6d9965879b0ce4a5
7
- data.tar.gz: c53724a213f8b63976250f2c18ca7643e0057eeeb4102101a9d2c1eb810acbc9c52b88a66ee8599c3be09d7f47714c4f9c618e6b64ec28f307adc937fa09d299
6
+ metadata.gz: bb64ec1e82f6106b597c1303dbea2bac8b5b6fd493d20a79a72421b01dd89583141ff1decd72bd2ea1172151258dc9474aedeefb805881e787e822b6fd9027a0
7
+ data.tar.gz: b2d40dcca0dfad041330e8c2dafe6b7072796109230ef8f11cb0e90bebabde4be06981a335ec1ab0aaa3118af568c6bd1b9257d9f0bedb768379ed1818137d08
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [4.1.1] - 2026-11-08
2
+ - Use the current MultiJSON API for JSON serialization, parsing, and parse errors to eliminate deprecation warnings and prepare for MultiJSON 2.0 (#330).
3
+ - Preserve Gibbon's public `symbolize_keys` option while passing `symbolize_names` to MultiJSON internally.
4
+
1
5
  ## [4.1.0] - 2026-11-02
2
6
  - Require Ruby 3.2+ (drops support for EOL Ruby 3.1)
3
7
  - Require `multi_json` 1.21.2+, whose JSON adapter supports `json` 3.x, and remove the `json < 3.0` constraint added in 4.0.1
data/README.markdown CHANGED
@@ -27,7 +27,7 @@ gem "gibbon"
27
27
  * **Ruby 3.2 or newer.** Gibbon 4.1 dropped support for Ruby 3.1; Gibbon 4.0 dropped support for Ruby 2.4 through 3.0.
28
28
  * A MailChimp account and API key. You can see your API keys [here](https://admin.mailchimp.com/account/api).
29
29
 
30
- Gibbon depends on [Faraday](https://github.com/lostisland/faraday) (both 1.x and 2.x are supported) and [MultiJson](https://github.com/intridea/multi_json). Connections to MailChimp negotiate TLS 1.2 or newer.
30
+ Gibbon depends on [Faraday](https://github.com/lostisland/faraday) (both 1.x and 2.x are supported) and [MultiJSON](https://github.com/sferik/multi_json). Connections to MailChimp negotiate TLS 1.2 or newer.
31
31
 
32
32
  ## Usage
33
33
 
@@ -513,7 +513,7 @@ Full release history lives in the [CHANGELOG](CHANGELOG.md). The breaking change
513
513
  Gibbon 4.1 contains no API changes. It changes what it runs on:
514
514
 
515
515
  * **Ruby 3.2 or newer is required.** Ruby 3.1 is EOL and is no longer supported. If you are on Ruby 3.1, stay on Gibbon 4.0.1.
516
- * **MultiJson 1.21.2 or newer is required**, and Gibbon no longer constrains the `json` gem. This lets you use `json` 3.x.
516
+ * **MultiJSON 1.21.2 or newer is required**, and Gibbon no longer constrains the `json` gem. This lets you use `json` 3.x.
517
517
 
518
518
  ### Upgrading to 4.0
519
519
 
@@ -23,7 +23,7 @@ module Gibbon
23
23
 
24
24
  begin
25
25
  response = self.rest_client.post do |request|
26
- configure_request(request: request, params: params, headers: headers, body: MultiJson.dump(body))
26
+ configure_request(request: request, params: params, headers: headers, body: MultiJSON.generate(body))
27
27
  end
28
28
  parse_response(response)
29
29
  rescue => e
@@ -39,7 +39,7 @@ module Gibbon
39
39
 
40
40
  begin
41
41
  response = self.rest_client.patch do |request|
42
- configure_request(request: request, params: params, headers: headers, body: MultiJson.dump(body))
42
+ configure_request(request: request, params: params, headers: headers, body: MultiJSON.generate(body))
43
43
  end
44
44
  parse_response(response)
45
45
  rescue => e
@@ -55,7 +55,7 @@ module Gibbon
55
55
 
56
56
  begin
57
57
  response = self.rest_client.put do |request|
58
- configure_request(request: request, params: params, headers: headers, body: MultiJson.dump(body))
58
+ configure_request(request: request, params: params, headers: headers, body: MultiJSON.generate(body))
59
59
  end
60
60
  parse_response(response)
61
61
  rescue => e
@@ -142,7 +142,7 @@ module Gibbon
142
142
  error_params[:status_code] = error.response[:status]
143
143
  error_params[:raw_body] = error.response[:body]
144
144
 
145
- parsed_response = MultiJson.load(error.response[:body], symbolize_keys: symbolize_keys)
145
+ parsed_response = MultiJSON.parse(error.response[:body], symbolize_names: symbolize_keys)
146
146
 
147
147
  if parsed_response
148
148
  error_params[:body] = parsed_response
@@ -155,7 +155,7 @@ module Gibbon
155
155
  end
156
156
 
157
157
  end
158
- rescue MultiJson::ParseError
158
+ rescue MultiJSON::ParseError
159
159
  end
160
160
 
161
161
  error_to_raise = MailChimpError.new(error.message, error_params)
@@ -198,9 +198,9 @@ module Gibbon
198
198
  if response.body && !response.body.empty?
199
199
  begin
200
200
  headers = response.headers
201
- body = MultiJson.load(response.body, symbolize_keys: symbolize_keys)
201
+ body = MultiJSON.parse(response.body, symbolize_names: symbolize_keys)
202
202
  parsed_response = Response.new(headers: headers, body: body)
203
- rescue MultiJson::ParseError
203
+ rescue MultiJSON::ParseError
204
204
  error_params = { title: "UNPARSEABLE_RESPONSE", status_code: 500 }
205
205
  error = MailChimpError.new("Unparseable response: #{response.body}", error_params)
206
206
  raise error
@@ -1,4 +1,4 @@
1
1
  module Gibbon
2
2
  # The released version of the gem.
3
- VERSION = "4.1.0"
3
+ VERSION = "4.1.1"
4
4
  end
@@ -89,7 +89,7 @@ describe Gibbon::APIRequest do
89
89
  expect(e.title).to eq "Invalid Resource"
90
90
  expect(e.detail).to eq "The resource submitted could not be validated."
91
91
  expect(e.raw_body).to eq error_body
92
- expect(e.body).to eq MultiJson.load(error_body)
92
+ expect(e.body).to eq MultiJSON.parse(error_body)
93
93
  end
94
94
  end
95
95
 
@@ -57,7 +57,7 @@ describe Gibbon::Request do
57
57
 
58
58
  it "maps create to POST" do
59
59
  stub = stub_request(:post, "#{api_root}/lists")
60
- .with(body: MultiJson.dump(body), basic_auth: basic_auth_credentials, headers: { 'Content-Type' => 'application/json' })
60
+ .with(body: MultiJSON.generate(body), basic_auth: basic_auth_credentials, headers: { 'Content-Type' => 'application/json' })
61
61
  .to_return(status: 200)
62
62
  @gibbon.lists.create(body: body)
63
63
  expect(stub).to have_been_requested
@@ -65,7 +65,7 @@ describe Gibbon::Request do
65
65
 
66
66
  it "maps update to PATCH" do
67
67
  stub = stub_request(:patch, "#{api_root}/lists/list123")
68
- .with(body: MultiJson.dump(body), basic_auth: basic_auth_credentials, headers: { 'Content-Type' => 'application/json' })
68
+ .with(body: MultiJSON.generate(body), basic_auth: basic_auth_credentials, headers: { 'Content-Type' => 'application/json' })
69
69
  .to_return(status: 200)
70
70
  @gibbon.lists("list123").update(body: body)
71
71
  expect(stub).to have_been_requested
@@ -73,7 +73,7 @@ describe Gibbon::Request do
73
73
 
74
74
  it "maps upsert to PUT" do
75
75
  stub = stub_request(:put, "#{api_root}/lists/list123")
76
- .with(body: MultiJson.dump(body), basic_auth: basic_auth_credentials, headers: { 'Content-Type' => 'application/json' })
76
+ .with(body: MultiJSON.generate(body), basic_auth: basic_auth_credentials, headers: { 'Content-Type' => 'application/json' })
77
77
  .to_return(status: 200)
78
78
  @gibbon.lists("list123").upsert(body: body)
79
79
  expect(stub).to have_been_requested
@@ -18,7 +18,7 @@ describe Gibbon do
18
18
 
19
19
  it 'supports upsert request' do
20
20
  stub_request(:put, "https://us1.api.mailchimp.com/3.0/lists/#{list_id}/members/#{member_id}")
21
- .with(body: MultiJson.dump(request_body), basic_auth: ['apikey', '1234-us1'])
21
+ .with(body: MultiJSON.generate(request_body), basic_auth: ['apikey', '1234-us1'])
22
22
  .to_return(status: 200)
23
23
 
24
24
  Gibbon::Request.new(api_key: api_key)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gibbon
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amro Mousa