erp_integration 0.62.0 → 0.63.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: 63269c49afd5a3ed49f2a21df8a3e4f102b4206f807ec2b856c0e35a62cea05a
4
- data.tar.gz: 5a31d04b8d8a7d45f08921a32d470e80d717b0e76d5e01757eb2c6ff6a3fe22c
3
+ metadata.gz: cb75aaf6e64d6ef01f00956f20fb796669477fd7c627e747f97980bff5ddb5da
4
+ data.tar.gz: '098968ee5bc648abc6dbc410d623d5561ddd692954b5b12f5e2abb5c6e955d0c'
5
5
  SHA512:
6
- metadata.gz: adffdd3bf7d3746d1256509f5572e52d4ab7be28cc064efc9dabc870ab6c0846ee81e5523ed37e641b13a870b686a53e84be2cb7c9ec478466c009c7aa0074e1
7
- data.tar.gz: 2b93cf2f5299db27f9a8dec86df24803641d58f641ec484437b21f943848da29068953952b96d236a2d95cf9de0588726fd2f28a52d562b2e0b3581247d9328f
6
+ metadata.gz: 82785e30614943d05dc3385bd11baf281cf306b7fcdd8723575dc8f1a4533abc05b4919accf6b346d29c03f1ab9719d411bd66ca8f727fa9ca416cab557ef812
7
+ data.tar.gz: c20e9376d1f3b151568d987a1626dee8bb4cb360eae8c7d011ea6e4b92e6ab1e20214f1f40565726d4c30f627b003b099b33783df66b8853ca04185f08548ae5
@@ -8,7 +8,7 @@ jobs:
8
8
 
9
9
  strategy:
10
10
  matrix:
11
- ruby-version: ['3.0', '2.7', '2.6', '2.5', '2.4', '2.3']
11
+ ruby-version: ['3.0', '3.3', '3.4']
12
12
 
13
13
  steps:
14
14
  - uses: actions/checkout@v2
data/.rubocop.yml CHANGED
@@ -16,7 +16,7 @@ Metrics/BlockLength:
16
16
  # 1. Specs tend to include big blocks (e.g. `RSpec.describe` or `it`).
17
17
  # 2. `mejuri-web` also has disabled the `Metrics/BlockLength` for specs.
18
18
  - spec/**/*
19
- ExcludedMethods: ['class_eval']
19
+ AllowedMethods: ['class_eval']
20
20
 
21
21
  Lint/AmbiguousBlockAssociation:
22
22
  Enabled: true
@@ -88,3 +88,8 @@ Metrics/ClassLength:
88
88
 
89
89
  Style/AndOr:
90
90
  EnforcedStyle: conditionals
91
+
92
+ Lint/ConstantDefinitionInBlock:
93
+ Exclude:
94
+ - spec/**/*
95
+
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.2
1
+ 3.3.6
data/README.md CHANGED
@@ -155,7 +155,7 @@ $ ErpIntegration::SalesOrder.select(:id, :reference).find_by(reference: 'MT1000S
155
155
 
156
156
  ## Development
157
157
 
158
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
158
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
159
159
 
160
160
  ### Releasing
161
161
 
@@ -39,10 +39,10 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency 'byebug', '~> 11.0'
40
40
  spec.add_development_dependency 'flay', '~> 2.12', '>= 2.12.1'
41
41
  spec.add_development_dependency 'github_changelog_generator', '~> 1.15.2'
42
- spec.add_development_dependency 'rake', '~> 13.0'
43
- spec.add_development_dependency 'reek', '< 6.0'
42
+ spec.add_development_dependency 'rake', '>= 13.0'
43
+ spec.add_development_dependency 'reek', '<= 6.4.0'
44
44
  spec.add_development_dependency 'rspec', '~> 3.10'
45
- spec.add_development_dependency 'rubocop', '< 0.82.0'
45
+ spec.add_development_dependency 'rubocop', '~> 1.71'
46
46
  spec.add_development_dependency 'rubocop-rake', '~> 0.5'
47
47
  spec.add_development_dependency 'rubocop-rspec', '< 1.39.0'
48
48
  spec.add_development_dependency 'webmock', '~> 3.18.1'
@@ -17,6 +17,7 @@ module ErpIntegration
17
17
  include QueryMethods
18
18
 
19
19
  attr_accessor :resource_klass
20
+
20
21
  delegate :api_keys_pool=, :client, :model_name, to: 'self.class'
21
22
 
22
23
  def initialize(resource_klass)
@@ -72,9 +73,9 @@ module ErpIntegration
72
73
  # be executed and the results will be fetched.
73
74
  # @return [Array] An enumerable collection object with all API results.
74
75
  def all
75
- return @results if defined?(@results)
76
+ return @all if defined?(@all)
76
77
 
77
- @results =
78
+ @all =
78
79
  client.put(
79
80
  api_resource_path,
80
81
  Query.new(
@@ -29,7 +29,7 @@ module ErpIntegration
29
29
  # @param alternative_filters [Array<OrClause>] A list of or clauses for Fulfil.
30
30
  # @param offset [Integer] Offset for pagination.
31
31
  # @param limit [Integer] Limit for pagination.
32
- def initialize(fields:, filters:, alternative_filters: [], offset: nil, limit: nil)
32
+ def initialize(fields:, filters:, alternative_filters: [], offset: nil, limit: nil) # rubocop:disable Metrics/CyclomaticComplexity
33
33
  @fields = (fields || DEFAULT_FIELDS).map(&:to_s).uniq
34
34
  @filters = (filters || []).map(&:to_filter).uniq
35
35
  @filters += alternative_filters.map(&:to_filter).uniq if alternative_filters&.any?
@@ -11,11 +11,11 @@ module ErpIntegration
11
11
 
12
12
  # Logs the given tags if the logger is present.
13
13
  # If the logger does not respond to `tagged`, it logs the tags as an info message.
14
- def with_tags(*tags)
14
+ def with_tags(*tags, &block)
15
15
  return yield unless logger
16
16
 
17
17
  if logger.respond_to?(:tagged)
18
- logger.tagged(*tags) { yield }
18
+ logger.tagged(*tags) { block.call }
19
19
  else
20
20
  logger.info("Requested ERP with #{tags.join(', ')}")
21
21
  yield
@@ -105,25 +105,13 @@ module ErpIntegration
105
105
  # @param kwargs [Hash] The list of arguments for the missing method.
106
106
  # @param block [Proc] Any block given to the missing method.
107
107
  #
108
- # rubocop:disable Style/MissingRespondToMissing
109
- if RUBY_VERSION < '2.7'
110
- def method_missing(method_name, *args, &block)
111
- if adapter.respond_to?(method_name)
112
- adapter.send(method_name, *args, &block)
113
- else
114
- super
115
- end
116
- end
117
- else
118
- def method_missing(method_name, *args, **kwargs, &block)
119
- if adapter.respond_to?(method_name)
120
- adapter.send(method_name, *args, **kwargs, &block)
121
- else
122
- super
123
- end
108
+ def method_missing(method_name, *args, **kwargs, &block)
109
+ if adapter.respond_to?(method_name)
110
+ adapter.send(method_name, *args, **kwargs, &block)
111
+ else
112
+ super
124
113
  end
125
114
  end
126
- # rubocop:enable Style/MissingRespondToMissing
127
115
 
128
116
  # The `respond_to_missing?` complements the `method_missing` method.
129
117
  # @param method_name [Symbol] The name of the missing method.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.62.0'
4
+ VERSION = '0.63.0'
5
5
  end
@@ -66,6 +66,7 @@ module ErpIntegration
66
66
  autoload :Persistence, 'erp_integration/resources/persistence'
67
67
  autoload :Validations, 'erp_integration/resources/validations'
68
68
  end
69
+
69
70
  module Types
70
71
  autoload :Decimal, 'erp_integration/types/decimal'
71
72
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.62.0
4
+ version: 0.63.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-03 00:00:00.000000000 Z
11
+ date: 2025-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -116,30 +116,30 @@ dependencies:
116
116
  name: rake
117
117
  requirement: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - "~>"
119
+ - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: '13.0'
122
122
  type: :development
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
- - - "~>"
126
+ - - ">="
127
127
  - !ruby/object:Gem::Version
128
128
  version: '13.0'
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: reek
131
131
  requirement: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - "<"
133
+ - - "<="
134
134
  - !ruby/object:Gem::Version
135
- version: '6.0'
135
+ version: 6.4.0
136
136
  type: :development
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - "<"
140
+ - - "<="
141
141
  - !ruby/object:Gem::Version
142
- version: '6.0'
142
+ version: 6.4.0
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: rspec
145
145
  requirement: !ruby/object:Gem::Requirement
@@ -158,16 +158,16 @@ dependencies:
158
158
  name: rubocop
159
159
  requirement: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - "<"
161
+ - - "~>"
162
162
  - !ruby/object:Gem::Version
163
- version: 0.82.0
163
+ version: '1.71'
164
164
  type: :development
165
165
  prerelease: false
166
166
  version_requirements: !ruby/object:Gem::Requirement
167
167
  requirements:
168
- - - "<"
168
+ - - "~>"
169
169
  - !ruby/object:Gem::Version
170
- version: 0.82.0
170
+ version: '1.71'
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: rubocop-rake
173
173
  requirement: !ruby/object:Gem::Requirement