active_utils 3.3.18 → 3.4.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: ba20b023488f4b47c77a36833387c62951f0fcf50eab1a0fca623a745cf54d71
4
- data.tar.gz: 9d7de1684d1c17b84db39717bba46abc43a68589bda5bd7030245ca3dda14e01
3
+ metadata.gz: 47ca23e9563451e7e1b9e8e4014a72b58fb33ebcbbf705624ed1ad05cc83cf6a
4
+ data.tar.gz: 4b26f12af37cfb198a86273c320dfb87f422a96f9fa9feb1901b120888126871
5
5
  SHA512:
6
- metadata.gz: adf0fe3ac25f1a6c5afbf4d893f8ff648b8b7dfc09b150e166b56d4d373b969c0fdd156ec28e8c3dffb6394e324a88184e9a3184dfa66baf014b2b331b51a5e6
7
- data.tar.gz: c7a6c626e7c3a3d24945bd4ceb8e2d64512ff30bdc60ede9466bc4c348d72974f93f10d05db136ec3502771ce413ca515eeb4f70bb7c8701e8c8352d228462ce
6
+ metadata.gz: 10f6afbf20b7b656cc980ec6be22d0ff302524210f47480f56515d9e646273131c83c4bfaddb93cee423f4c3305e185ff4d38f9ff588212737eb690087b43bb3
7
+ data.tar.gz: c1b88683c03a582a36efbb40ed08a94cd9cf4d9f27b172f4451fcc799ef9f51e3002465cc8bf6192299ea87c3e3b2a63b7c82519ce67c0639082eb2b9a3b52c7
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # ActiveUtils changelog
2
2
 
3
+ ### Version 3.4.0 (February 23, 2022)
4
+ - Add AC and TA to `ActiveUtils::Country::COUNTRIES`
5
+
6
+ ### Version 3.3.19 (February 24, 2020)
7
+ - Support `net/http` default proxy settings from `ENV['http_proxy']`
8
+ - Support usage of custom ssl certificate with `ENV['SSL_CERT_FILE']`, default variable for Ruby
9
+
3
10
  ### Version 3.3.17 (February 24, 2020)
4
11
  - Add support for PATCH HTTP method in `ActiveUtils#Connection`
5
12
 
@@ -11,9 +11,12 @@ module ActiveUtils
11
11
  OPEN_TIMEOUT = 60
12
12
  READ_TIMEOUT = 60
13
13
  VERIFY_PEER = true
14
- CA_FILE = (File.dirname(__FILE__) + '/../certs/cacert.pem')
14
+ # allow using proxy for https calls by pointing to it's certificate
15
+ # SSL_CERT_FILE is variable used by Ruby to look for certificate for net/http
16
+ CA_FILE = ENV.fetch('SSL_CERT_FILE', File.dirname(__FILE__) + '/../certs/cacert.pem')
15
17
  CA_PATH = nil
16
18
  RETRY_SAFE = false
19
+ PROXY_ADDRESS = :ENV
17
20
  RUBY_184_POST_HEADERS = { "Content-Type" => "application/x-www-form-urlencoded" }
18
21
 
19
22
  attr_accessor :endpoint
@@ -45,7 +48,7 @@ module ActiveUtils
45
48
  @max_retries = MAX_RETRIES
46
49
  @ignore_http_status = false
47
50
  @ssl_version = nil
48
- @proxy_address = nil
51
+ @proxy_address = PROXY_ADDRESS
49
52
  @proxy_port = nil
50
53
  end
51
54
 
@@ -66,6 +66,7 @@ module ActiveUtils #:nodoc:
66
66
  { :alpha2 => 'AF', :name => 'Afghanistan', :alpha3 => 'AFG', :numeric => '004' },
67
67
  { :alpha2 => 'AX', :name => 'Aland Islands', :alpha3 => 'ALA', :numeric => '248' },
68
68
  { :alpha2 => 'AL', :name => 'Albania', :alpha3 => 'ALB', :numeric => '008' },
69
+ { :alpha2 => 'AC', :name => 'Ascension Island', :alpha3 => 'ASC' },
69
70
  { :alpha2 => 'DZ', :name => 'Algeria', :alpha3 => 'DZA', :numeric => '012' },
70
71
  { :alpha2 => 'AS', :name => 'American Samoa', :alpha3 => 'ASM', :numeric => '016' },
71
72
  { :alpha2 => 'AD', :name => 'Andorra', :alpha3 => 'AND', :numeric => '020' },
@@ -291,6 +292,7 @@ module ActiveUtils #:nodoc:
291
292
  { :alpha2 => 'TK', :name => 'Tokelau', :alpha3 => 'TKL', :numeric => '772' },
292
293
  { :alpha2 => 'TO', :name => 'Tonga', :alpha3 => 'TON', :numeric => '776' },
293
294
  { :alpha2 => 'TT', :name => 'Trinidad and Tobago', :alpha3 => 'TTO', :numeric => '780' },
295
+ { :alpha2 => 'TA', :name => 'Tristan da Cunha', :alpha3 => 'TAA' },
294
296
  { :alpha2 => 'TN', :name => 'Tunisia', :alpha3 => 'TUN', :numeric => '788' },
295
297
  { :alpha2 => 'TR', :name => 'Turkey', :alpha3 => 'TUR', :numeric => '792' },
296
298
  { :alpha2 => 'TM', :name => 'Turkmenistan', :alpha3 => 'TKM', :numeric => '795' },
@@ -24,6 +24,8 @@ module ActiveUtils #:nodoc:
24
24
  base.class_attribute :wiredump_device
25
25
 
26
26
  base.class_attribute :proxy_address
27
+ base.proxy_address = Connection::PROXY_ADDRESS
28
+
27
29
  base.class_attribute :proxy_port
28
30
  end
29
31
 
@@ -1,3 +1,3 @@
1
1
  module ActiveUtils
2
- VERSION = "3.3.18"
2
+ VERSION = "3.4.0"
3
3
  end
@@ -61,4 +61,13 @@ class PostsDataTest < Minitest::Test
61
61
  assert_equal @poster.proxy_address, 'http://proxy.example.com'
62
62
  assert_equal @poster.proxy_port, '8888'
63
63
  end
64
+
65
+ class HttpConnectionAbort < StandardError; end
66
+
67
+ def test_respecting_environment_proxy_settings
68
+ Net::HTTP.stubs(:new).with('example.com', 80, :ENV, nil).raises(PostsDataTest::HttpConnectionAbort)
69
+ assert_raises(PostsDataTest::HttpConnectionAbort) do
70
+ @poster.ssl_post('http://example.com', '')
71
+ end
72
+ end
64
73
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.18
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-30 00:00:00.000000000 Z
11
+ date: 2023-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -87,7 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - ".github/probots.yml"
90
+ - ".github/workflows/cla.yml"
91
91
  - ".gitignore"
92
92
  - ".travis.yml"
93
93
  - CHANGELOG.md
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.2.20
146
+ rubygems_version: 3.3.3
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Common utils used by active_merchant, active_fulfillment, and active_shipping
data/.github/probots.yml DELETED
@@ -1,2 +0,0 @@
1
- enabled:
2
- - cla