dhc 1.0.0 → 2.0.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: 2b22e30900912a713bfb89ff65a146da3ddba654aa02b9b0352fb857d2df9c33
4
- data.tar.gz: 54958fd32986660a12ecd05fe2e73f74873dea1eaac303a6bee53b5050ebe321
3
+ metadata.gz: 0ca76978c02b0282cb78e1bdca008c209ea28f8a23f424fbb94c4aec639c4ccc
4
+ data.tar.gz: 42cd56ebb4db087b70a3ade68b56ac7da0cb823b3b19751c2dda1accca4c7a86
5
5
  SHA512:
6
- metadata.gz: 3153ef2ea5a6602daedfb2d6264d40b3092d047e508c29ec4090e47b9372d820e7199e129acf5fa24468edc38903ed814f8e33acf2ff50f08c30a5c3890facab
7
- data.tar.gz: 0b6753fa4e0792a533ec0667a1084e223f374008a1b999dd6e01e423f18e6e063e099aea321a80681c06ee9885a9d89e009ae737273ebd385e48c4de8a6b3561
6
+ metadata.gz: a1d76646f40bf13cb1e773b6e851f1923a53457d3e4b51ba4f7bf88f2e9e2c923d71d99cd32846ec564c19eb94dc2933303a2aa61298a8f7010ba41dd939676a
7
+ data.tar.gz: 472a083db1738e1e12e3a611e8c133add777d3b6adc67ebbae5f124dc5fb550452e4d10604233361d935b201f8d9598bdc23d40e799e1d8f4f785ff5469b0f0a
@@ -8,20 +8,9 @@ jobs:
8
8
 
9
9
  steps:
10
10
  - uses: actions/checkout@v2
11
- - uses: actions/setup-ruby@v1
11
+ - uses: ruby/setup-ruby@master
12
12
  with:
13
- ruby-version: 2.7.2
14
- - name: Cache Ruby Gems
15
- uses: actions/cache@v2
16
- with:
17
- path: /.tmp/vendor/bundle
18
- key: ${{ runner.os }}-gems-latest-${{ hashFiles('**/Gemfile.lock') }}
19
- restore-keys: |
20
- ${{ runner.os }}-gems-latest-
21
- - name: Bundle Install
22
- run: |
23
- bundle config path /.tmp/vendor/bundle
24
- bundle install --jobs 4 --retry 3
13
+ bundler-cache: true
25
14
  - name: Run Rubocop
26
15
  run: |
27
16
  bundle exec rubocop
@@ -8,20 +8,9 @@ jobs:
8
8
 
9
9
  steps:
10
10
  - uses: actions/checkout@v2
11
- - uses: actions/setup-ruby@v1
11
+ - uses: ruby/setup-ruby@master
12
12
  with:
13
- ruby-version: 2.7.2
14
- - name: Cache Ruby Gems
15
- uses: actions/cache@v2
16
- with:
17
- path: /.tmp/vendor/bundle
18
- key: ${{ runner.os }}-gems-latest-${{ hashFiles('**/Gemfile.lock') }}
19
- restore-keys: |
20
- ${{ runner.os }}-gems-latest-
21
- - name: Bundle Install
22
- run: |
23
- bundle config path /.tmp/vendor/bundle
24
- bundle install --jobs 4 --retry 3
13
+ bundler-cache: true
25
14
  - name: Run Tests
26
15
  run: |
27
16
  bundle exec rspec
data/README.md CHANGED
@@ -941,7 +941,7 @@ config.middleware.use ZipkinTracer::RackHandler, {
941
941
 
942
942
  #### Interceptor callbacks
943
943
 
944
- `before_raw_request` is called before the raw typhoeus request is prepared/created.
944
+ `before_init` is called before the raw typhoeus request has been initialized.
945
945
 
946
946
  `before_request` is called when the request is prepared and about to be executed.
947
947
 
@@ -12,7 +12,7 @@ class DHC::Interceptor
12
12
  @request.response
13
13
  end
14
14
 
15
- def before_raw_request; end
15
+ def before_init; end
16
16
 
17
17
  def before_request; end
18
18
 
@@ -4,7 +4,7 @@ class DHC::Auth < DHC::Interceptor
4
4
  include ActiveSupport::Configurable
5
5
  config_accessor :refresh_client_token
6
6
 
7
- def before_raw_request
7
+ def before_init
8
8
  body_authentication! if auth_options[:body]
9
9
  end
10
10
 
@@ -8,7 +8,7 @@ class DHC::DefaultTimeout < DHC::Interceptor
8
8
  CONNECTTIMEOUT = 2 # seconds
9
9
  TIMEOUT = 15 # seconds
10
10
 
11
- def before_raw_request
11
+ def before_init
12
12
  request_options = (request.options || {})
13
13
  request_options[:timeout] ||= timeout || TIMEOUT
14
14
  request_options[:connecttimeout] ||= connecttimeout || CONNECTTIMEOUT
data/lib/dhc/request.rb CHANGED
@@ -22,7 +22,7 @@ class DHC::Request
22
22
  use_configured_endpoint!
23
23
  generate_url_from_template!
24
24
  self.interceptors = DHC::Interceptors.new(self)
25
- interceptors.intercept(:before_raw_request)
25
+ interceptors.intercept(:before_init)
26
26
  self.raw = create_request
27
27
  interceptors.intercept(:before_request)
28
28
  if self_executing && !response
data/lib/dhc/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DHC
4
- VERSION ||= '1.0.0'
4
+ VERSION ||= '2.0.0'
5
5
  end
@@ -19,6 +19,6 @@ describe Hash do
19
19
  end
20
20
 
21
21
  it 'applies upcase to all values' do
22
- expect(subject.deep_transform_values { |value| value.upcase }).to eq(expected_result)
22
+ expect(subject.deep_transform_values(&:upcase)).to eq(expected_result)
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/DePayFi/dhc/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-31 00:00:00.000000000 Z
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport