active_utils 3.4.2 → 3.6.0

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: 749cb044fcb177e843182013d5caaf8a6a13efa33c1218644df2c1ffddecf0b5
4
- data.tar.gz: 35a1d31ebe872e755c590e3a3055c1c6b54b7672274f766774b21eca5d6c3016
3
+ metadata.gz: 573d4f872e7eb4088934db0121c99539f8e904c5e238f86cf75c80efdf5a6024
4
+ data.tar.gz: 83ba430d4ed0202d8676aeb88da792b3d063f8e1af8f20fc2e727ed0fce538de
5
5
  SHA512:
6
- metadata.gz: 22ea40eaf40d232ad00f92c9460a139b59792df62fa9b9ca469adb6b32a66182bc5630f7f11bc90e75e38816a5d55ebca2dd7df746f9d652ef725e56bf3f54f7
7
- data.tar.gz: f29ec7086e81adf45ab458e388677ca07ce9c66fdf5e3779dfb94421237f39cc708653e3d6bdc16f5edf5eba149219defb39697783f17f7bbbacb5b38d79cd2b
6
+ metadata.gz: 321c201934f5528369b2b7d9266aa372ecb37b04413f6b49c3c2cd8da810d4831473d6279bff890b12eb5b967a44591ac01679bd749da1d12e7696a53a97c6da
7
+ data.tar.gz: fe0f4497ba31a54aa6788c21f1e82484c0b4ca40a5591733520a181cef04f63d15ac7611b75a1dcd4253edfec144ce6d6edb9b6fc2635f1c4f87e8e4aab0acae
@@ -11,6 +11,10 @@ registries:
11
11
  username: ${{secrets.DEPENDENCIES_GITHUB_USER}}
12
12
  password: ${{secrets.DEPENDENCIES_GITHUB_TOKEN}}
13
13
  updates:
14
+ - package-ecosystem: github-actions
15
+ directory: "/"
16
+ schedule:
17
+ interval: weekly
14
18
  - package-ecosystem: bundler
15
19
  directory: "/"
16
20
  schedule:
@@ -8,7 +8,7 @@ jobs:
8
8
  steps:
9
9
  - name: Dependabot metadata
10
10
  id: metadata
11
- uses: dependabot/fetch-metadata@v1.6.0
11
+ uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 # v1.6.0
12
12
  with:
13
13
  github-token: "${{ secrets.GITHUB_TOKEN }}"
14
14
 
@@ -16,7 +16,7 @@ jobs:
16
16
  id: check_ci_failure
17
17
  continue-on-error: true
18
18
  if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.dependency-group == 'auto_merge' }}
19
- uses: actions/github-script@v6
19
+ uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
20
20
  with:
21
21
  script: |
22
22
  function sleep(ms) {
@@ -62,7 +62,7 @@ jobs:
62
62
  core.setOutput("ci_state", ci_state)
63
63
  - name: Send Slack notification if auto-merge failed
64
64
  if: ${{ steps.check_ci_failure.outputs.ci_state == 'false' }}
65
- uses: ruby/action-slack@v3.0.0
65
+ uses: ruby/action-slack@b6882ea6ef8f556f9f9af9ec1220d3f1ced74acf # v3.0.0
66
66
  with:
67
67
  payload: |
68
68
  {
@@ -77,7 +77,7 @@ jobs:
77
77
 
78
78
  - name: Approve and merge
79
79
  if: ${{ steps.check_ci_failure.outputs.ci_state == 'true' && (steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.dependency-group == 'auto_merge') }}
80
- uses: actions/github-script@v6
80
+ uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
81
81
  with:
82
82
  script: |
83
83
  await github.rest.pulls.createReview({
@@ -14,9 +14,9 @@ jobs:
14
14
  matrix:
15
15
  version: [ '2.7', '3.0', '3.1', '3.2', '3.3' ]
16
16
  steps:
17
- - uses: actions/checkout@v4
17
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18
18
  - name: Set up Ruby ${{ matrix.version }}
19
- uses: ruby/setup-ruby@v1
19
+ uses: ruby/setup-ruby@e34163cd15f4bb403dcd72d98e295997e6a55798 # v1.238.0
20
20
  with:
21
21
  ruby-version: ${{ matrix.version }}
22
22
  bundler-cache: true
data/CHANGELOG.md CHANGED
@@ -1,94 +1,131 @@
1
1
  # ActiveUtils changelog
2
2
 
3
+ ### Version 3.6.0 (September 15, 2025)
4
+
5
+ - Catch and raise `Errno::ENETUNREACH` syscall errors as `ActiveUtils::ConnectionError`
6
+
7
+ ### Version 3.5.0 (February 04, 2025)
8
+
9
+ - Catch and raise `EHOSTUNREACH` and `EADDRNOTAVAIL` syscall errors as `ActiveUtils::ConnectionError`
10
+
3
11
  ### Version 3.4.2 (January 15, 2025)
12
+
4
13
  - Remove numeric as a required param for `ActiveUtils::Country`
5
14
 
6
15
  ### Version 3.4.1 (APril 04, 2023)
16
+
7
17
  - Fix depracated deprecated calling of `=~` on Object which is removed by ruby 3.2.0 as described here: https://bugs.ruby-lang.org/issues/15231
8
18
 
9
19
  ### Version 3.4.0 (February 23, 2022)
20
+
10
21
  - Add AC and TA to `ActiveUtils::Country::COUNTRIES`
11
22
 
12
23
  ### Version 3.3.19 (February 24, 2020)
24
+
13
25
  - Support `net/http` default proxy settings from `ENV['http_proxy']`
14
26
  - Support usage of custom ssl certificate with `ENV['SSL_CERT_FILE']`, default variable for Ruby
15
27
 
16
28
  ### Version 3.3.17 (February 24, 2020)
29
+
17
30
  - Add support for PATCH HTTP method in `ActiveUtils#Connection`
18
31
 
19
32
  ### Version 3.3.16 (December 18, 2018)
33
+
20
34
  - Add `VU` to `ActiveUtils::Country::COUNTRIES_THAT_DO_NOT_USE_POSTALCODES`
21
35
 
22
36
  ### Version 3.3.15 (November 29, 2018)
37
+
23
38
  - Remove support to Ruby 1.9 and ActiveSupport `< 4`
24
39
  - Remove the upperbound constraint on ActiveSupport
25
40
 
26
41
  ### Version 3.3.14 (November 28, 2018)
42
+
27
43
  - Add `MW` to `ActiveUtils::Country::COUNTRIES_THAT_DO_NOT_USE_POSTALCODES`
28
44
 
29
45
  ### Version 3.3.13 (November 26, 2018)
46
+
30
47
  - Add support for custom retriable exceptions in `NetworkConnectionRetries#retry_exceptions`
31
48
 
32
49
  ### Version 3.3.12 (July 11, 2018)
50
+
33
51
  - Update CA bundle
34
52
 
35
53
  ### Version 3.3.11 (March 14, 2018)
54
+
36
55
  - Add the DigiCert Global Root G2 to the CA bundle
37
56
 
38
57
  ### Version 3.3.10 (February 28, 2018)
58
+
39
59
  - Support ActiveSupport 5.2
40
60
 
41
61
  ### Version 3.3.9 (September 28, 2017)
62
+
42
63
  - Add remaining currencies to `ActiveUtils::CurrencyCode::ISO_CURRENCIES`
43
64
  - Update bundler in `travis.yml`
44
65
 
45
66
  ### Version 3.3.8 (August 15, 2017)
67
+
46
68
  - Add `BO` to `ActiveUtils::Country::COUNTRIES_THAT_DO_NOT_USE_POSTALCODES`
47
69
 
48
70
  ### Version 3.3.7 (June 26, 2017)
71
+
49
72
  - Add `CVE` to `ActiveUtils::CurrencyCode::ISO_CURRENCIES`
50
73
 
51
74
  ### Version 3.3.6 (May 23, 2017)
75
+
52
76
  - Add `South Sudan` country in `ActiveUtils::Country::COUNTRIES_THAT_DO_NOT_USE_POSTALCODES`
53
77
 
54
78
  ### Version 3.3.5 (May 18, 2017)
79
+
55
80
  - Add `South Sudan` and `Antarctica` countries in `ActiveUtils::Country::COUNTRIES`
56
81
 
57
82
  ### Version 3.3.4 (Apr. 18, 2017)
83
+
58
84
  - Add `Ghana` country in `ActiveUtils::Country::COUNTRIES_THAT_DO_NOT_USE_POSTALCODES`
59
85
 
60
86
  ### Version 3.3.3 (Apr. 7, 2017)
87
+
61
88
  - Add the `Aland Islands` country in `ActiveUtils::Country::COUNTRIES`
62
89
 
63
90
  ### Version 3.3.2 (Mar. 28, 2017)
91
+
64
92
  - Changed country name of "Libyan Arab Jamahiriya" to Libya, as per country name change in 2011.
65
93
 
66
94
  ### Version 3.3.1 (Mar. 28, 2017)
95
+
67
96
  - Bump ActiveSupport requirement to **< 5.2.0**.
68
97
 
69
98
  ### Version 3.3.0 (Mar. 10, 2017)
99
+
70
100
  - Reduced default PostsData open_timeout from 60 seconds to 2, and read_timeout from 60 seconds to 10. Subclasses can and should override those values.
71
101
  - Replace Kosovo's alpha 2 and alpha 3 ISO codes from `KV` to `XK` and from `KSV` to `XKX`.
72
102
 
73
103
  ### Version 3.2.5 (Feb. 2, 2017)
104
+
74
105
  - Add the `TMT` currency in the supported currency codes
75
106
 
76
107
  ### Version 3.2.4 (Dec. 16, 2016)
108
+
77
109
  - Add the `Bonaire` country in `ActiveUtils::Country::COUNTRIES`
78
110
 
79
111
  ### Version 3.2.3 (Nov. 21, 2016)
112
+
80
113
  - Add the `:delay` option in `ActiveUtils::NetworkConnectionRetries`
81
114
 
82
115
  ### Version 3.2.2 (Jul. 4, 2016)
116
+
83
117
  - Add tests for Rails 5 support
84
118
 
85
119
  ### Version 3.2.1 (Oct. 26, 2015)
120
+
86
121
  - Add the malaysian currency code "RM" in `ActiveUtils::CurrencyCode`
87
122
 
88
123
  ### Version 3.2.0 (Oct. 13, 2015)
124
+
89
125
  - Add #uses_postal_codes? to `ActiveUtils::Country`
90
126
 
91
127
  ### Version 3.1.0 (Sept. 30, 2015)
128
+
92
129
  - Use ActiveUtils::HTTPRequestError as base exception class
93
130
  - Add proxy address and port configuration
94
131
  - Add support for Sin Maarten
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_utils (3.4.2)
4
+ active_utils (3.6.0)
5
5
  activesupport (>= 4.2)
6
6
  i18n
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.1.5.1)
11
+ activesupport (7.1.5.2)
12
12
  base64
13
13
  benchmark (>= 0.3)
14
14
  bigdecimal
@@ -21,15 +21,15 @@ GEM
21
21
  mutex_m
22
22
  securerandom (>= 0.3)
23
23
  tzinfo (~> 2.0)
24
- base64 (0.2.0)
25
- benchmark (0.4.0)
26
- bigdecimal (3.1.9)
27
- concurrent-ruby (1.3.4)
28
- connection_pool (2.5.0)
29
- drb (2.2.1)
30
- i18n (1.14.6)
24
+ base64 (0.3.0)
25
+ benchmark (0.4.1)
26
+ bigdecimal (3.2.3)
27
+ concurrent-ruby (1.3.5)
28
+ connection_pool (2.5.4)
29
+ drb (2.2.3)
30
+ i18n (1.14.7)
31
31
  concurrent-ruby (~> 1.0)
32
- logger (1.6.5)
32
+ logger (1.7.0)
33
33
  minitest (5.22.3)
34
34
  mocha (2.1.0)
35
35
  ruby2_keywords (>= 0.0.5)
@@ -43,6 +43,7 @@ GEM
43
43
  PLATFORMS
44
44
  arm64-darwin-21
45
45
  arm64-darwin-23
46
+ arm64-darwin-24
46
47
  x86_64-linux
47
48
 
48
49
  DEPENDENCIES
@@ -7,7 +7,10 @@ module ActiveUtils
7
7
  Timeout::Error => "The connection to the remote server timed out",
8
8
  Errno::ETIMEDOUT => "The connection to the remote server timed out",
9
9
  SocketError => "The connection to the remote server could not be established",
10
- OpenSSL::SSL::SSLError => "The SSL connection to the remote server could not be established"
10
+ OpenSSL::SSL::SSLError => "The SSL connection to the remote server could not be established",
11
+ Errno::EHOSTUNREACH => "The remote server could not be reached",
12
+ Errno::EADDRNOTAVAIL => "The remote server address is not available",
13
+ Errno::ENETUNREACH => "The destination network is unreachable"
11
14
  }
12
15
 
13
16
  DEFAULT_RETRY_ERRORS = {
@@ -1,3 +1,3 @@
1
1
  module ActiveUtils
2
- VERSION = "3.4.2"
2
+ VERSION = "3.6.0"
3
3
  end
@@ -32,6 +32,33 @@ class NetworkConnectionRetriesTest < Minitest::Test
32
32
  assert_equal "The remote server reset the connection", raised.message
33
33
  end
34
34
 
35
+ def test_ehostunreach_raises_correctly
36
+ raised = assert_raises(ActiveUtils::ConnectionError) do
37
+ retry_exceptions do
38
+ raise Errno::EHOSTUNREACH
39
+ end
40
+ end
41
+ assert_equal "The remote server could not be reached", raised.message
42
+ end
43
+
44
+ def test_eaddrnotavail_raises_correctly
45
+ raised = assert_raises(ActiveUtils::ConnectionError) do
46
+ retry_exceptions do
47
+ raise Errno::EADDRNOTAVAIL
48
+ end
49
+ end
50
+ assert_equal "The remote server address is not available", raised.message
51
+ end
52
+
53
+ def test_enetunreach_raises_correctly
54
+ raised = assert_raises(ActiveUtils::ConnectionError) do
55
+ retry_exceptions do
56
+ raise Errno::ENETUNREACH
57
+ end
58
+ end
59
+ assert_equal "The destination network is unreachable", raised.message
60
+ end
61
+
35
62
  def test_timeout_errors_raise_correctly
36
63
  exceptions = [Timeout::Error, Errno::ETIMEDOUT]
37
64
  if RUBY_VERSION >= '2.0.0'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.2
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubygems_version: 3.6.2
148
+ rubygems_version: 3.7.2
149
149
  specification_version: 4
150
150
  summary: Common utils used by active_merchant, active_fulfillment, and active_shipping
151
151
  test_files: []