creditsafe 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5e6b555edb6131078c45308e06860adbfb18afdf8326eccedf0e3b40bf12d32
4
- data.tar.gz: 04e6caab6be667db17b3d2f0dea79c610b2b3e2972066cdbb0d97fdbaf65b9d4
3
+ metadata.gz: b8b73972a559fa2c2a39d2aa8155fe6369c9cefa3285502c9a21d34536bae3c6
4
+ data.tar.gz: ff09f26c803fdba79e4bc33bb0af3b8dfd3098d0d280c81532edbbfe08e3dc9a
5
5
  SHA512:
6
- metadata.gz: dd71392a827914caf224daf0d4d4f7b5b99628e7f08679e93cdea57ab2d91893931cd0942b8c8fc1f5e0b2942cd375193fb80d883f41068cdc24871148e38ab0
7
- data.tar.gz: 4f430154fc5c8d6414426f92f75b09dc340bd9506abd9899cd7711eaeda28aaf4f98ce4f5a0ace1758e11bcc024bf93c7207f97ff8a1a448d2a187af4fdcba89
6
+ metadata.gz: 123929e34d1a1c6f5069164a4c4d2824cdcad775a4edd4b08af102b29e1f1721921d28a8cb33b8e45b9ad713b1e30e2c9e1baa7f9c270ee94a45282e8a0c160d
7
+ data.tar.gz: 91393f169e292ecb3e8e24a77bdd480fbafcc02a17ddd15c9d1d810e308e4fb5a1d05e39349a1229beaf18b43cc6bf977ff39932a911f817252bb4e2ac567562
data/.circleci/config.yml CHANGED
@@ -1,17 +1,66 @@
1
- version: 2
1
+ ---
2
+ version: 2.1
3
+
4
+ references:
5
+ bundle_install: &bundle_install
6
+ run:
7
+ name: Bundle
8
+ command: |
9
+ gem install bundler --no-document && \
10
+ bundle config set no-cache 'true' && \
11
+ bundle config set jobs '4' && \
12
+ bundle config set retry '3' && \
13
+ bundle install
14
+
15
+ cache_bundle: &cache_bundle
16
+ save_cache:
17
+ key: bundle-<< parameters.ruby_version >>-{{ checksum "creditsafe.gemspec" }}-{{ checksum "Gemfile" }}
18
+ paths:
19
+ - vendor/bundle
20
+
21
+ restore_bundle: &restore_bundle
22
+ restore_cache:
23
+ key: bundle-<< parameters.ruby_version >>-{{ checksum "creditsafe.gemspec" }}-{{ checksum "Gemfile" }}
24
+
25
+ steps: &steps
26
+ - checkout
27
+ - *restore_bundle
28
+ - *bundle_install
29
+ - *cache_bundle
30
+ - run:
31
+ name: Run specs
32
+ command: |
33
+ circleci tests glob "spec/**/*_spec.rb"
34
+ bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) --profile --format progress --format RspecJunitFormatter -o /tmp/circle_artifacts/rspec.xml
35
+ - run:
36
+ name: "Rubocop"
37
+ command: bundle exec rubocop --extra-details --display-style-guide --parallel --force-exclusion
38
+ - store_artifacts:
39
+ path: /tmp/circle_artifacts/
40
+ - store_test_results:
41
+ path: /tmp/circle_artifacts/
42
+
43
+ ruby_versions: &ruby_versions
44
+ - "2.7"
45
+ - "3.0"
46
+
2
47
  jobs:
3
- build:
4
- working_directory: ~/creditsafe-ruby
48
+ test_and_lint:
49
+ working_directory: /mnt/ramdisk
50
+ parameters:
51
+ ruby_version:
52
+ type: string
5
53
  docker:
6
- - image: ruby:2.5
7
- steps:
8
- - checkout
9
- - restore_cache:
10
- key: bundler-v1-{{ checksum "creditsafe.gemspec" }}-{{ checksum ".ruby-version" }}
11
- - run: bundle install --path vendor/bundle
12
- - save_cache:
13
- key: bundler-v1-{{ checksum "creditsafe.gemspec" }}-{{ checksum ".ruby-version" }}
14
- paths:
15
- - "vendor/bundle"
16
- - run: bundle exec rubocop
17
- - run: bundle exec rspec --format RspecJunitFormatter
54
+ - image: cimg/ruby:<< parameters.ruby_version >>
55
+ environment:
56
+ CIRCLE_TEST_REPORTS: /tmp/circle_artifacts/
57
+ steps: *steps
58
+
59
+ workflows:
60
+ version: 2
61
+ tests:
62
+ jobs:
63
+ - test_and_lint:
64
+ matrix:
65
+ parameters:
66
+ ruby_version: *ruby_versions
@@ -0,0 +1,17 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ open-pull-requests-limit: 10
8
+ ignore:
9
+ - dependency-name: webmock
10
+ versions:
11
+ - 3.11.1
12
+ - 3.11.2
13
+ - 3.11.3
14
+ - 3.12.0
15
+ - dependency-name: pry
16
+ versions:
17
+ - 0.14.0
data/.rubocop.yml CHANGED
@@ -10,5 +10,9 @@ RSpec/ExampleLength:
10
10
  RSpec/MultipleExpectations:
11
11
  Max: 2
12
12
 
13
+ AllCops:
14
+ TargetRubyVersion: 2.7
15
+ NewCops: enable
16
+
13
17
  RSpec/ImplicitBlockExpectation:
14
18
  Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.6
1
+ 3.0.2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## v0.7.0, 5 October 2021
2
+
3
+ - Rename Constants::Country to Creditsafe::Country, to avoid polluting other namespaces
4
+ - Update dependencies: activesupport, excon
5
+ - Downgrade savon
6
+ - Require Ruby 2.7+
7
+
1
8
  ## v0.6.3, 18 December 2019
2
9
 
3
10
  - Update dependencies: excon
data/creditsafe.gemspec CHANGED
@@ -12,23 +12,24 @@ Gem::Specification.new do |spec|
12
12
  spec.summary = "Ruby client for the Creditsafe SOAP API"
13
13
  spec.homepage = "https://github.com/gocardless/creditsafe-ruby"
14
14
  spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.7.0"
15
16
 
16
17
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
19
  spec.require_paths = ["lib"]
19
20
 
20
- spec.add_runtime_dependency "activesupport", "~> 5.2"
21
- spec.add_runtime_dependency "excon", "~> 0.71"
22
- spec.add_runtime_dependency "savon", "~> 2.12"
21
+ spec.add_runtime_dependency "activesupport"
22
+ spec.add_runtime_dependency "excon", "~> 0.85"
23
+ spec.add_runtime_dependency "savon", "~> 2.11"
23
24
 
24
25
  spec.add_development_dependency "compare-xml", "~> 0.66"
25
- spec.add_development_dependency "gc_ruboconfig", "~> 2.3.14"
26
- spec.add_development_dependency "pry", "~> 0.12.2"
26
+ spec.add_development_dependency "gc_ruboconfig", "~> 2.28"
27
+ spec.add_development_dependency "pry", "~> 0.14"
27
28
  spec.add_development_dependency "rspec", "~> 3.8"
28
29
  spec.add_development_dependency "rspec-its", "~> 1.3"
29
- spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
30
- spec.add_development_dependency "rubocop", "~> 0.61.1"
31
- spec.add_development_dependency "rubocop-rspec", "~> 1.35"
32
- spec.add_development_dependency "timecop", "~> 0.9.1"
33
- spec.add_development_dependency "webmock", "~> 3.7.2"
30
+ spec.add_development_dependency "rspec_junit_formatter", "~> 0.4"
31
+ spec.add_development_dependency "rubocop", "~> 1.20"
32
+ spec.add_development_dependency "rubocop-rspec", "~> 2.4"
33
+ spec.add_development_dependency "timecop", "~> 0.9"
34
+ spec.add_development_dependency "webmock", "~> 3.14"
34
35
  end
@@ -87,14 +87,14 @@ module Creditsafe
87
87
  response = client.call(message_type, message: message)
88
88
  handle_message_for_response(response)
89
89
  notification_payload[:response] = response.body
90
- rescue Excon::Errors::Timeout => raw_error
91
- notification_payload[:error] = handle_error(raw_error)
90
+ rescue Excon::Errors::Timeout => e
91
+ notification_payload[:error] = handle_error(e)
92
92
  raise TimeoutError
93
- rescue Excon::Errors::BadGateway => raw_error
94
- notification_payload[:error] = handle_error(raw_error)
93
+ rescue Excon::Errors::BadGateway => e
94
+ notification_payload[:error] = handle_error(e)
95
95
  raise BadGatewayError
96
- rescue => raw_error
97
- processed_error = handle_error(raw_error)
96
+ rescue => e
97
+ processed_error = handle_error(e)
98
98
  notification_payload[:error] = processed_error
99
99
  raise processed_error
100
100
  ensure
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Constants
3
+ module Creditsafe
4
4
  module Country
5
5
  AUSTRALIA = "AU"
6
6
  AUSTRIA = "AT"
@@ -4,14 +4,20 @@ module Creditsafe
4
4
  class Error < StandardError; end
5
5
 
6
6
  class HttpError < Error; end
7
+
7
8
  class ApiError < Error; end
8
9
 
9
10
  class TimeoutError < HttpError; end
11
+
10
12
  class BadGatewayError < HttpError; end
11
13
 
12
14
  class DataError < ApiError; end
15
+
13
16
  class AccountError < ApiError; end
17
+
14
18
  class RequestError < ApiError; end
19
+
15
20
  class ProcessingError < ApiError; end
21
+
16
22
  class UnknownApiError < ApiError; end
17
23
  end
@@ -31,7 +31,7 @@ module Creditsafe
31
31
  end
32
32
  end
33
33
 
34
- # rubocop:disable Metrics/LineLength
34
+ # rubocop:disable Layout/LineLength
35
35
  NO_RESULTS = Message.new(code: "010101", message: "No results")
36
36
  TOO_MANY_RESULTS = Message.new(code: "010102", message: "Too many results")
37
37
  REPORT_UNAVAILABLE = Message.new(code: "010103", message: "Report unavailable", error: true)
@@ -54,7 +54,7 @@ module Creditsafe
54
54
  OTHER_ERROR = Message.new(code: "040102", message: "Other", error: true)
55
55
  DATA_SERVICE_PROBLEMS = Message.new(code: "040103", message: "Data service access problems", error: true)
56
56
  DATA_SERVICE_INVALID_RESPONSE = Message.new(code: "040104", message: "Data service invalid response", error: true)
57
- # rubocop:enable Metrics/LineLength
57
+ # rubocop:enable Layout/LineLength
58
58
 
59
59
  ALL = [
60
60
  NO_RESULTS,
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "creditsafe/match_type"
4
4
  require "creditsafe/namespace"
5
- require "creditsafe/constants"
5
+ require "creditsafe/country"
6
6
 
7
7
  module Creditsafe
8
8
  module Request
@@ -77,7 +77,6 @@ module Creditsafe
77
77
 
78
78
  # rubocop:disable Metrics/CyclomaticComplexity
79
79
  # rubocop:disable Metrics/MethodLength
80
- # rubocop:disable Metrics/PerceivedComplexity
81
80
  # rubocop:disable Metrics/AbcSize
82
81
  def check_search_criteria(search_criteria)
83
82
  if search_criteria[:country_code].nil?
@@ -97,13 +96,12 @@ module Creditsafe
97
96
  raise ArgumentError, "Postal code is only supported for German searches"
98
97
  end
99
98
 
100
- if search_criteria[:vat_number] && !Constants::Country::VAT_NUMBER_SUPPORTED.
99
+ if search_criteria[:vat_number] && !Creditsafe::Country::VAT_NUMBER_SUPPORTED.
101
100
  include?(search_criteria[:country_code])
102
101
  raise ArgumentError, "VAT number is not supported in this country"
103
102
  end
104
103
  end
105
104
  # rubocop:enable Metrics/AbcSize
106
- # rubocop:enable Metrics/PerceivedComplexity
107
105
  # rubocop:enable Metrics/MethodLength
108
106
  # rubocop:enable Metrics/CyclomaticComplexity
109
107
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditsafe
4
- VERSION = "0.6.3"
4
+ VERSION = "0.7.0"
5
5
  end
@@ -154,7 +154,7 @@ RSpec.describe(Creditsafe::Client) do
154
154
  vat_number: vat_number,
155
155
  city: city,
156
156
  postal_code: postal_code,
157
- }.reject { |_, v| v.nil? }
157
+ }.compact
158
158
  end
159
159
 
160
160
  let(:find_company) { client.find_company(search_criteria) }
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: creditsafe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless Engineering
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-18 00:00:00.000000000 Z
11
+ date: 2021-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.2'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '5.2'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: excon
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.71'
33
+ version: '0.85'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.71'
40
+ version: '0.85'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: savon
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.12'
47
+ version: '2.11'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.12'
54
+ version: '2.11'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: compare-xml
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.3.14
75
+ version: '2.28'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 2.3.14
82
+ version: '2.28'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.12.2
89
+ version: '0.14'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.12.2
96
+ version: '0.14'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -128,71 +128,71 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.4.1
131
+ version: '0.4'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.4.1
138
+ version: '0.4'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.61.1
145
+ version: '1.20'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.61.1
152
+ version: '1.20'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop-rspec
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '1.35'
159
+ version: '2.4'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '1.35'
166
+ version: '2.4'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: timecop
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.9.1
173
+ version: '0.9'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 0.9.1
180
+ version: '0.9'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: webmock
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 3.7.2
187
+ version: '3.14'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 3.7.2
195
- description:
194
+ version: '3.14'
195
+ description:
196
196
  email:
197
197
  - engineering@gocardless.com
198
198
  executables: []
@@ -200,6 +200,7 @@ extensions: []
200
200
  extra_rdoc_files: []
201
201
  files:
202
202
  - ".circleci/config.yml"
203
+ - ".github/dependabot.yml"
203
204
  - ".gitignore"
204
205
  - ".rspec"
205
206
  - ".rubocop.yml"
@@ -213,7 +214,7 @@ files:
213
214
  - data/creditsafe-test.xml
214
215
  - lib/creditsafe.rb
215
216
  - lib/creditsafe/client.rb
216
- - lib/creditsafe/constants.rb
217
+ - lib/creditsafe/country.rb
217
218
  - lib/creditsafe/errors.rb
218
219
  - lib/creditsafe/match_type.rb
219
220
  - lib/creditsafe/messages.rb
@@ -239,7 +240,7 @@ homepage: https://github.com/gocardless/creditsafe-ruby
239
240
  licenses:
240
241
  - MIT
241
242
  metadata: {}
242
- post_install_message:
243
+ post_install_message:
243
244
  rdoc_options: []
244
245
  require_paths:
245
246
  - lib
@@ -247,16 +248,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
247
248
  requirements:
248
249
  - - ">="
249
250
  - !ruby/object:Gem::Version
250
- version: '0'
251
+ version: 2.7.0
251
252
  required_rubygems_version: !ruby/object:Gem::Requirement
252
253
  requirements:
253
254
  - - ">="
254
255
  - !ruby/object:Gem::Version
255
256
  version: '0'
256
257
  requirements: []
257
- rubyforge_project:
258
- rubygems_version: 2.7.6.2
259
- signing_key:
258
+ rubygems_version: 3.2.22
259
+ signing_key:
260
260
  specification_version: 4
261
261
  summary: Ruby client for the Creditsafe SOAP API
262
262
  test_files: