creditsafe 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +66 -17
  3. data/.github/dependabot.yml +17 -0
  4. data/.gitignore +4 -2
  5. data/.rspec +1 -1
  6. data/.rubocop.yml +18 -11
  7. data/.ruby-version +1 -1
  8. data/CHANGELOG.md +64 -45
  9. data/Gemfile +5 -5
  10. data/LICENSE.txt +22 -22
  11. data/README.md +175 -175
  12. data/creditsafe.gemspec +35 -35
  13. data/data/creditsafe-live.xml +342 -342
  14. data/data/creditsafe-test.xml +342 -342
  15. data/lib/creditsafe/client.rb +165 -158
  16. data/lib/creditsafe/{constants.rb → country.rb} +49 -49
  17. data/lib/creditsafe/errors.rb +23 -16
  18. data/lib/creditsafe/match_type.rb +115 -115
  19. data/lib/creditsafe/messages.rb +98 -97
  20. data/lib/creditsafe/namespace.rb +20 -20
  21. data/lib/creditsafe/request/company_report.rb +42 -42
  22. data/lib/creditsafe/request/find_company.rb +118 -120
  23. data/lib/creditsafe/version.rb +5 -5
  24. data/lib/creditsafe.rb +4 -4
  25. data/spec/creditsafe/client_spec.rb +431 -423
  26. data/spec/creditsafe/messages_spec.rb +76 -76
  27. data/spec/fixtures/company-report-not-found.xml +13 -13
  28. data/spec/fixtures/company-report-request.xml +1 -1
  29. data/spec/fixtures/company-report-successful.xml +582 -582
  30. data/spec/fixtures/error-fault.xml +8 -8
  31. data/spec/fixtures/error-invalid-credentials.html +31 -31
  32. data/spec/fixtures/find-companies-error-no-text.xml +11 -11
  33. data/spec/fixtures/find-companies-error.xml +11 -11
  34. data/spec/fixtures/find-companies-none-found.xml +13 -13
  35. data/spec/fixtures/find-companies-request.xml +1 -1
  36. data/spec/fixtures/find-companies-successful-multi.xml +493 -493
  37. data/spec/fixtures/find-companies-successful.xml +29 -29
  38. data/spec/spec_helper.rb +14 -14
  39. metadata +46 -46
  40. data/Gemfile.lock +0 -129
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d7e9dc737539af843ce3a9b181fdb7d08bdcd7c1
4
- data.tar.gz: b05479c1bd360574152a8d2e2d73f975248da52e
2
+ SHA256:
3
+ metadata.gz: b8b73972a559fa2c2a39d2aa8155fe6369c9cefa3285502c9a21d34536bae3c6
4
+ data.tar.gz: ff09f26c803fdba79e4bc33bb0af3b8dfd3098d0d280c81532edbbfe08e3dc9a
5
5
  SHA512:
6
- metadata.gz: bcee6d9fb09ce4ece19f833031437f6ccd721f13456cdb0278a434f1f05ed86dc9ba364fd79924c74f4e08b975c620d0919998165ddc35416962635fc45dde01
7
- data.tar.gz: 14da6df79c7baf7de5ca7989311a5deafee3efd36b060cad04d9ec3fc5b4cb9bb626f2a17574c2a9e0197ffbdec1a5ae583ac83aa8129312f0aa680caba54bf1
6
+ metadata.gz: 123929e34d1a1c6f5069164a4c4d2824cdcad775a4edd4b08af102b29e1f1721921d28a8cb33b8e45b9ad713b1e30e2c9e1baa7f9c270ee94a45282e8a0c160d
7
+ data.tar.gz: 91393f169e292ecb3e8e24a77bdd480fbafcc02a17ddd15c9d1d810e308e4fb5a1d05e39349a1229beaf18b43cc6bf977ff39932a911f817252bb4e2ac567562
data/.circleci/config.yml CHANGED
@@ -1,17 +1,66 @@
1
- version: 2
2
- jobs:
3
- build:
4
- working_directory: ~/creditsafe-ruby
5
- docker:
6
- - image: ruby:2.5.0
7
- steps:
8
- - checkout
9
- - restore_cache:
10
- key: gemfile-{{ checksum "Gemfile" }}
11
- - run: bundle install --path vendor/bundle
12
- - save_cache:
13
- key: gemfile-{{ checksum "Gemfile" }}
14
- paths:
15
- - "vendor/bundle"
16
- - run: bundle exec rubocop
17
- - run: bundle exec rspec --format RspecJunitFormatter
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
+
47
+ jobs:
48
+ test_and_lint:
49
+ working_directory: /mnt/ramdisk
50
+ parameters:
51
+ ruby_version:
52
+ type: string
53
+ docker:
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/.gitignore CHANGED
@@ -1,2 +1,4 @@
1
- .bundle/
2
- bin/
1
+ .bundle/
2
+ bin/
3
+ *.gem
4
+ Gemfile.lock
data/.rspec CHANGED
@@ -1 +1 @@
1
- --color
1
+ --color
data/.rubocop.yml CHANGED
@@ -1,11 +1,18 @@
1
- inherit_gem:
2
- gc_ruboconfig: rubocop.yml
3
-
4
- RSpec/NestedGroups:
5
- Max: 5
6
-
7
- RSpec/ExampleLength:
8
- Max: 20
9
-
10
- RSpec/MultipleExpectations:
11
- Max: 2
1
+ inherit_gem:
2
+ gc_ruboconfig: rubocop.yml
3
+
4
+ RSpec/NestedGroups:
5
+ Max: 5
6
+
7
+ RSpec/ExampleLength:
8
+ Max: 20
9
+
10
+ RSpec/MultipleExpectations:
11
+ Max: 2
12
+
13
+ AllCops:
14
+ TargetRubyVersion: 2.7
15
+ NewCops: enable
16
+
17
+ RSpec/ImplicitBlockExpectation:
18
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 3.0.2
data/CHANGELOG.md CHANGED
@@ -1,45 +1,64 @@
1
- ## v0.6.0, 25 September 2018
2
-
3
- - Add searching by VAT number
4
-
5
- ## v0.5.2, 29 March 2018
6
-
7
- - Raise `Creditsafe::TimeoutError` when a request times out
8
-
9
- ## v0.5.1, 1 March 2018
10
-
11
- - Update allowed MatchTypes for some geos to reflect real world tests
12
-
13
- ## v0.5.0, 27 February 2018
14
-
15
- - Automatically chooses a valid MatchType when searching for companies by name
16
-
17
- ## v0.4.0, 3 April 2017
18
-
19
- - Adds support for including a postal code when searching for German companies by name
20
- (@manojapr)
21
-
22
- ## v0.3.2, 27 February 2017
23
-
24
- - Adds support for using Creditsafe's test environment, specified when instantiating the
25
- client, as well as customising the log level used by the Savon SOAP client
26
- - Adds support for finding companies in Germany by name, as well as company number
27
-
28
- ## v0.3.1, 6 January 2017
29
-
30
- - Suppress password when inspecting client
31
-
32
- ## v0.3.0, 4 August 2016
33
-
34
- - Add instrumentation to SOAP requests
35
-
36
- ## v0.2.0, 16 March 2016
37
-
38
- - Subclass `ApiError` to distinguish between different Creditsafe error types
39
- (patch by [greysteil](https://github.com/greysteil))
40
-
41
-
42
- ## v0.1.1, 15 February 2016
43
-
44
- - Allow `city` parameter in `find_company` for German company lookups
45
- (patch by [greysteil](https://github.com/greysteil))
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
+
8
+ ## v0.6.3, 18 December 2019
9
+
10
+ - Update dependencies: excon
11
+
12
+ ## v0.6.2, 4 January 2019
13
+
14
+ - Treat Bad Gateway (502) errors separately
15
+
16
+ ## v0.6.1, 6 November 2018
17
+
18
+ - Update dependencies: activesupport, nokogiri, pry, rack
19
+
20
+ ## v0.6.0, 25 September 2018
21
+
22
+ - Add searching by VAT number
23
+
24
+ ## v0.5.2, 29 March 2018
25
+
26
+ - Raise `Creditsafe::TimeoutError` when a request times out
27
+
28
+ ## v0.5.1, 1 March 2018
29
+
30
+ - Update allowed MatchTypes for some geos to reflect real world tests
31
+
32
+ ## v0.5.0, 27 February 2018
33
+
34
+ - Automatically chooses a valid MatchType when searching for companies by name
35
+
36
+ ## v0.4.0, 3 April 2017
37
+
38
+ - Adds support for including a postal code when searching for German companies by name
39
+ (@manojapr)
40
+
41
+ ## v0.3.2, 27 February 2017
42
+
43
+ - Adds support for using Creditsafe's test environment, specified when instantiating the
44
+ client, as well as customising the log level used by the Savon SOAP client
45
+ - Adds support for finding companies in Germany by name, as well as company number
46
+
47
+ ## v0.3.1, 6 January 2017
48
+
49
+ - Suppress password when inspecting client
50
+
51
+ ## v0.3.0, 4 August 2016
52
+
53
+ - Add instrumentation to SOAP requests
54
+
55
+ ## v0.2.0, 16 March 2016
56
+
57
+ - Subclass `ApiError` to distinguish between different Creditsafe error types
58
+ (patch by [greysteil](https://github.com/greysteil))
59
+
60
+
61
+ ## v0.1.1, 15 February 2016
62
+
63
+ - Allow `city` parameter in `find_company` for German company lookups
64
+ (patch by [greysteil](https://github.com/greysteil))
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2017 GoCardless Ltd
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2017 GoCardless Ltd
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.