dhs 1.5.0 → 1.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: c02b8006074cd3482fac996fcf904ed9e904d6ab8f8b504afcd9c27318dd5724
4
- data.tar.gz: 2ce157d1fd6f0333d9638516e650f2ef040b6f08145664e4f3e8b041f908ca66
3
+ metadata.gz: 79388bf9da2d5952b1df95513287bbd412dcb5196c99889ea91e28f302cbc64d
4
+ data.tar.gz: e18e9e03e4130cbc2e4dadddb63603170ffee5c2791eb2e64418f39b33f664c8
5
5
  SHA512:
6
- metadata.gz: 8975d2399f0a7a63066fdf8e23b96dbf2b9809bd9e75efc73a85779b1a32e97eae997dce4573222ed5d7b1556ca9dc2276d12eee5dddfa911d71698ae26b10d0
7
- data.tar.gz: 9d00278274df289db27965f24a6bc2a106d46e64ea09814b8129d5aeae15f6e0e2d7e7cde37a7f7b49447142ecc52a960ea458bef1cb9f46396ec9457c2acd97
6
+ metadata.gz: 3ccb5289a230ea385574091368925d293106fae4fb5874ead856fb85a68bfa726a531a7adf9ad5b9499c82f24a8a355cf9ac5eb8741b1eb30c862762b3ed6b08
7
+ data.tar.gz: 42edbdaadbf8adc52e7a8a05a979d7b498aa0c8aa084718e29e0237282164482d37cb4b5d499e19633245f8a72e81a67f0fc167a9e8ce87bdf0efad20899932d
data/dhs.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
 
25
25
  s.add_dependency 'activemodel'
26
26
  s.add_dependency 'activesupport', '>= 6'
27
+ s.add_dependency 'nio4r', '>= 2.7.1'
27
28
  s.add_dependency 'dhc', '>= 2'
28
29
  s.add_dependency 'local_uri'
29
30
 
@@ -1,17 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support'
4
- require 'active_support/per_thread_registry'
4
+ require 'active_support/core_ext/module/attribute_accessors_per_thread'
5
5
 
6
6
  module DHS
7
7
  module OptionBlocks
8
8
  extend ActiveSupport::Concern
9
9
 
10
10
  class CurrentOptionBlock
11
- # Using ActiveSupports PerThreadRegistry to be able to support Active Support v4.
12
- # Will switch to thread_mattr_accessor (which comes with Activesupport) when we dropping support for Active Support v4.
13
- extend ActiveSupport::PerThreadRegistry
14
- attr_accessor :options
11
+ thread_mattr_accessor :options
15
12
  end
16
13
 
17
14
  module ClassMethods
@@ -1,17 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support'
4
- require 'active_support/per_thread_registry'
4
+ require 'active_support/core_ext/module/attribute_accessors_per_thread'
5
5
 
6
6
  module DHS
7
7
  module Interceptors
8
8
  module AutoOauth
9
9
  extend ActiveSupport::Concern
10
10
  class ThreadRegistry
11
- # Using ActiveSupports PerThreadRegistry to be able to support Active Support v4.
12
- # Will switch to thread_mattr_accessor (which comes with Activesupport) when we dropping support for Active Support v4.
13
- extend ActiveSupport::PerThreadRegistry
14
- attr_accessor :access_token
11
+ thread_mattr_accessor :access_token
15
12
  end
16
13
  end
17
14
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support'
4
- require 'active_support/per_thread_registry'
4
+ require 'active_support/core_ext/module/attribute_accessors_per_thread'
5
5
 
6
6
  module DHS
7
7
  module Interceptors
@@ -9,10 +9,7 @@ module DHS
9
9
  extend ActiveSupport::Concern
10
10
 
11
11
  class ThreadRegistry
12
- # Using ActiveSupports PerThreadRegistry to be able to support Active Support v4.
13
- # Will switch to thread_mattr_accessor (which comes with Activesupport) when we dropping support for Active Support v4.
14
- extend ActiveSupport::PerThreadRegistry
15
- attr_accessor :log
12
+ thread_mattr_accessor :log
16
13
  end
17
14
  end
18
15
  end
@@ -1,17 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support'
4
- require 'active_support/per_thread_registry'
5
-
4
+ require 'active_support/core_ext/module/attribute_accessors_per_thread'
6
5
  module DHS
7
6
  module Interceptors
8
7
  module RequestCycleCache
9
8
  extend ActiveSupport::Concern
10
9
  class ThreadRegistry
11
- # Using ActiveSupports PerThreadRegistry to be able to support Active Support v4.
12
- # Will switch to thread_mattr_accessor (which comes with Activesupport) when we dropping support for Active Support v4.
13
- extend ActiveSupport::PerThreadRegistry
14
- attr_accessor :request_id
10
+ thread_mattr_accessor :request_id
15
11
  end
16
12
  end
17
13
  end
@@ -9,7 +9,7 @@ class DHS::Pagination::NextParameter < DHS::Pagination::Base
9
9
  end
10
10
  alias count total
11
11
 
12
- def self.next_offset(offset, limit)
12
+ def self.next_offset(_offset, _limit)
13
13
  nil
14
14
  end
15
15
 
@@ -24,7 +24,7 @@ class DHS::Pagination::NextParameter < DHS::Pagination::Base
24
24
 
25
25
  def next(current)
26
26
  next_value = current.dig(*_record.pagination_key(:body))
27
- return if next_value.blank? || next_value.blank?
27
+ return if next_value.blank?
28
28
  {
29
29
  _record.pagination_key(:parameter) => current.dig(*_record.pagination_key(:body))
30
30
  }
data/lib/dhs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DHS
4
- VERSION = '1.5.0'
4
+ VERSION = '1.6.0'
5
5
  end
@@ -4,9 +4,8 @@ require 'rails_helper'
4
4
 
5
5
  describe DHS::Record do
6
6
  context 'next parameter pagination' do
7
-
8
7
  def stub_api_request(this_parameter:, next_parameter:, items: [])
9
- stub_request(:get, ["http://depay.fi/v2/transactions?limit=100", this_parameter ? "next=#{this_parameter}" : nil].compact.join('&'))
8
+ stub_request(:get, ['http://depay.fi/v2/transactions?limit=100', this_parameter ? "next=#{this_parameter}" : nil].compact.join('&'))
10
9
  .to_return(body: { items: items, next: next_parameter }.to_json)
11
10
  end
12
11
 
@@ -31,9 +30,8 @@ describe DHS::Record do
31
30
  end
32
31
 
33
32
  context 'next parameter pagination with items configuration and nil response' do
34
-
35
33
  def stub_api_request(this_parameter:, next_parameter:, items: [])
36
- stub_request(:get, ["http://depay.fi/v2/transactions?limit=100", this_parameter ? "next=#{this_parameter}" : nil].compact.join('&'))
34
+ stub_request(:get, ['http://depay.fi/v2/transactions?limit=100', this_parameter ? "next=#{this_parameter}" : nil].compact.join('&'))
37
35
  .to_return(body: { assets: items, next: next_parameter }.to_json)
38
36
  end
39
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/DePayFi/dhs/graphs/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-14 00:00:00.000000000 Z
11
+ date: 2024-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nio4r
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.7.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.7.1
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: dhc
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -582,7 +596,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
582
596
  version: '0'
583
597
  requirements:
584
598
  - Ruby >= 2.7.2
585
- rubygems_version: 3.2.3
599
+ rubygems_version: 3.3.26
586
600
  signing_key:
587
601
  specification_version: 4
588
602
  summary: 'REST services accelerator: Rails gem providing an easy, active-record-like