addressfinder 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Dockerfile +4 -4
- data/LICENSE.md +15 -0
- data/README.md +6 -5
- data/addressfinder.gemspec +3 -3
- data/lib/addressfinder.rb +7 -3
- data/lib/addressfinder/bulk.rb +5 -1
- data/lib/addressfinder/{cleanse.rb → verification.rb} +4 -3
- data/lib/addressfinder/version.rb +1 -1
- data/spec/lib/addressfinder/bulk_spec.rb +20 -4
- data/spec/lib/addressfinder/{cleanse_spec.rb → verification_spec.rb} +21 -21
- metadata +10 -8
- data/LICENSE +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2191b3d7090b6eb2c2001f080427cc917c5af00262520c907b401a2a3d7c82e
|
4
|
+
data.tar.gz: bd35444c4cb2a31a47130ded4dae80596718a4d6998006ffc34b92512cf729dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08384b27d66dd5397f8e07dc550b86ea0befa4eaae6f8f294dcb8f01e4372739bebfe0484a6874fd0f3f05b6f19ed21108e7923fd8416379532d5b799bb5c60f'
|
7
|
+
data.tar.gz: aadab0cc138ef723af46bd2e6baf1ac6571f51ecaba2dcfa2aedd34ff44b3a5c44b78f39ca5c2828edea29ae3329f1e22ec8ddfdc787482c24142202ece4b749
|
data/CHANGELOG.md
CHANGED
data/Dockerfile
CHANGED
@@ -15,9 +15,9 @@ ENV BUNDLE_PATH /bundle
|
|
15
15
|
ENV INSTALL_PATH /addressfinder-ruby
|
16
16
|
RUN mkdir -p $INSTALL_PATH
|
17
17
|
|
18
|
-
# Create address
|
19
|
-
RUN mkdir -p $INSTALL_PATH/
|
20
|
-
RUN mkdir -p $INSTALL_PATH/
|
18
|
+
# Create address verification directories
|
19
|
+
RUN mkdir -p $INSTALL_PATH/verification/originals
|
20
|
+
RUN mkdir -p $INSTALL_PATH/verification/verified
|
21
21
|
|
22
22
|
# This sets the context of where commands will be ran in and is documented
|
23
23
|
# on Docker's website extensively.
|
@@ -25,4 +25,4 @@ WORKDIR $INSTALL_PATH
|
|
25
25
|
|
26
26
|
ADD . $INSTALL_PATH
|
27
27
|
|
28
|
-
RUN bundle install
|
28
|
+
RUN bundle install
|
data/LICENSE.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Copyright (c) 2015-present AddressFinder
|
2
|
+
|
3
|
+
The intellectual property rights in this plugin are owned by AddressFinder Limited of Wellington New Zealand (referred to below as “we”, “us” or “our”) or its third party licensors. The plugin may be accessed and used by AddressFinder customers only, subject to the following terms. If you are not, or are no longer, an AddressFinder customer you are not permitted to access or use the plugin in any way.
|
4
|
+
|
5
|
+
If you are an AddressFinder customer (referred to below as “you” or “your”), the following terms apply in relation to your access and use of the plugin (and your access or use of the plugin confirms your acceptance of the following terms). If you do not accept the following terms you are not permitted to access or use the plugin in any way.
|
6
|
+
* In these terms, “Terms and Conditions” means the applicable Terms and Conditions that you entered into, being either https://addressfinder.nz/legal/terms/ or https://addressfinder.com.au/legal/terms/, and “Services” and “Subscription Term” have the meaning given in the Terms and Conditions.
|
7
|
+
* All rights, title and interest (including, without limitation, all intellectual property rights) in and to the plugin are owned by us or our third party licensors. Provided that you comply with these terms, and the Terms and Conditions, we grant you the right during your Subscription Term to: (a) access and use the plugin solely in connection with the Services and then only in combination with websites that you own or control; and (b) view the source code and configurations of the plugin solely for the purpose of evaluating the plugin in relation to its use in connection with the Services, and for no other purpose. This right is non-exclusive, non-transferable and may be revoked by us at any time. You are not granted any other rights or licences in relation to the plugin.
|
8
|
+
* You must never copy, modify, publish, merge, distribute, resell, lease, transfer or sub-license, or create derivative works from, all or any part of the plugin. You must never access or use the plugin for any purpose related to building a product or service which competes with the Services or the plugin or has similar features or functionality. You must comply with all instructions or restrictions that we provide to you in relation to the plugin (including, without limitation, that we may post on this page from time to time).
|
9
|
+
* The plugin is provided to you on an "as is" and "as available" basis and your use of it is at your sole risk. To the maximum extent permitted by law, we do not represent or warrant that the plugin will be secure, reliable, uninterrupted, always available, free of errors, omissions, inaccuracies, viruses or other destructive code, or that it will be fit for your purposes or for use in any specific technical environment or that any problems can or will be corrected. To the maximum extent permitted by law, we give no warranties in relation to the plugin. To avoid doubt, to the maximum extent permitted by law, we disclaim and exclude all implied representations, warranties and conditions (including any warranties of fitness for purpose, merchantability, title and non-infringement). Certain legislation may imply warranties or conditions, impose obligations or give statutory guarantees (together, Statutory Provisions) which cannot be excluded, restricted or modified except to a limited extent. These terms must be read subject to applicable Statutory Provisions. If the Statutory Provisions apply, notwithstanding any other provision of these terms, to the extent to which we are entitled to do so, we limit our liability in respect of any claim to: (a) in the case of goods, at our option: the replacement of the goods or the supply of equivalent goods; the repair of the goods; the payment of the cost of replacing the goods or acquiring equivalent goods; or the payment of having the goods repaired; and (b) in the case of services, at our option: the supply of the services again; or the payment of the cost of having the services supplied again. If you entered into our New Zealand Terms and Conditions, you represent to us that you are acquiring the right to use the plugin for the purposes of a business and so you agree that the provisions of the Consumer Guarantees Act 1993 do not apply to the plugin.
|
10
|
+
* To the maximum extent permitted by law, we and Our Related Parties will not be liable to you or any third party for any loss or damage to data, breach of security, loss of profit, revenue, opportunity or saving, or any incidental, indirect, special or consequential loss or damage. To the maximum extent permitted by law, the total aggregate liability of us and Our Related Parties (together) to you under or in connection with these terms or its subject matter is limited to NZ$10. These limitations and exclusions of liability apply however liability arises, whether in contract, in tort (including negligence), for breach of statutory duty or otherwise. You fully indemnify us from and against any claim, proceeding, damage, loss, liability, cost or expense (including legal costs on a solicitor and own client basis) arising from or connected to your use of plugin or breach of these terms. In these terms “Our Related Parties” means AddressFinder Pty Limited, ACN 606 672 333, any related company of us or AddressFinder Pty Limited (where “related company” has the meaning given in section 2(3) of the Companies Act 1993, and includes any company or similar entity which would be a related company within that definition if incorporated as a company in New Zealand) and our suppliers, contractors, directors, employees and agents.
|
11
|
+
* We may change these terms at any time by emailing you, by updating the Terms and Conditions and/or by displaying or referring to the replacement terms on this page. Your continued use of the plugin after you receive notice of any such changes will amount to your acceptance of those changes. If you don’t accept those changes you must immediately stop using the plugin.
|
12
|
+
* Any waiver of any part of these terms must be in writing and signed by one of our authorised representatives. Any delay or failure by us to exercise any right does not prevent us from exercising that right, or any other right, on that or any other occasion.
|
13
|
+
* Any unlawful or unenforceable provision of these terms will be deemed to be amended to the minimum extent necessary to ensure that it is not unlawful or unenforceable and, as far as is possible, to ensure that it is consistent with the intent and effect of the provision. The remaining provisions will be enforceable as if such unlawful or unenforceable provision had not been included in these terms. If the provision is unable to be amended without materially altering the intent and effect of the provision, it will be severed, and the remaining provisions will be enforceable.
|
14
|
+
* The terms are governed by the laws of New Zealand and you and we submit to the non-exclusive jurisdiction of the New Zealand courts.
|
15
|
+
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# AddressFinder Ruby Gem
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/addressfinder.svg)](http://badge.fury.io/rb/addressfinder)
|
4
|
-
[![Build Status](https://travis-ci.
|
4
|
+
[![Build Status](https://travis-ci.com/github/AddressFinder/addressfinder-ruby.svg)](https://travis-ci.com/github/AddressFinder/addressfinder-ruby)
|
5
5
|
|
6
6
|
A client library for accessing the [AddressFinder](https://addressfinder.nz/?utm_source=github&utm_medium=readme&utm_campaign=addressfinder_rubygem&utm_term=AddressFinder) APIs.
|
7
7
|
|
@@ -56,7 +56,7 @@ For available parameters and example responses, see the API documentation pages
|
|
56
56
|
#### Address Verification
|
57
57
|
|
58
58
|
```ruby
|
59
|
-
result = AddressFinder.
|
59
|
+
result = AddressFinder.verification(q: '186 Willis St, Wellington', country: 'nz')
|
60
60
|
|
61
61
|
if result
|
62
62
|
$stdout.puts "Success: #{result.postal}"
|
@@ -65,6 +65,8 @@ else
|
|
65
65
|
end
|
66
66
|
```
|
67
67
|
|
68
|
+
**Note:** The deprecated method `cleanse` is still available now but will be dropped in the future.
|
69
|
+
|
68
70
|
#### Address Search
|
69
71
|
|
70
72
|
The Address Search API supports the following address sets:
|
@@ -161,12 +163,12 @@ end
|
|
161
163
|
If you have a series of API requests, you can use the
|
162
164
|
bulk method to re-use the HTTP connection.
|
163
165
|
|
164
|
-
**Note:** The bulk method is currently only available for Address Verification (`#
|
166
|
+
**Note:** The bulk method is currently only available for Address Verification (`#verification`).
|
165
167
|
|
166
168
|
```ruby
|
167
169
|
AddressFinder.bulk do |af|
|
168
170
|
CSV.foreach('auckland_addresses.csv') do |row|
|
169
|
-
result = af.
|
171
|
+
result = af.verification(q: row[0], region_code: '1')
|
170
172
|
|
171
173
|
if result
|
172
174
|
$stdout.puts "Success: #{result.postal}"
|
@@ -205,4 +207,3 @@ You can run all the specs with the following command:
|
|
205
207
|
You can `guard` for repeating test runs (while editing new code):
|
206
208
|
|
207
209
|
`docker-compose run ruby bundle exec guard`
|
208
|
-
|
data/addressfinder.gemspec
CHANGED
@@ -5,11 +5,11 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.name = "addressfinder"
|
6
6
|
gem.version = AddressFinder::VERSION
|
7
7
|
gem.licenses = ['MIT']
|
8
|
-
gem.authors = ["Nigel Ramsay", "Naiki Pohe", "Sean Arnold", "Alexandre Barret"]
|
9
|
-
gem.email = ["nigel.ramsay@
|
8
|
+
gem.authors = ["Nigel Ramsay", "Naiki Pohe", "Sean Arnold", "Alexandre Barret", "Cassandre Guinut"]
|
9
|
+
gem.email = ["nigel.ramsay@addressfinder.nz", "naiki.pohe@abletech.co.nz", "seanarnie@gmail.com", "alex@abletech.nz", "cassandre.guinut@addressfinder.nz"]
|
10
10
|
gem.description = %q{Ruby client library for AddressFinder}
|
11
11
|
gem.summary = %q{Provides easy access to AddressFinder APIs}
|
12
|
-
gem.homepage = "https://github.com/
|
12
|
+
gem.homepage = "https://github.com/AddressFinder/addressfinder-ruby"
|
13
13
|
|
14
14
|
gem.files = `git ls-files`.split($/)
|
15
15
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/addressfinder.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'multi_json'
|
2
2
|
require 'addressfinder/version'
|
3
3
|
require 'addressfinder/configuration'
|
4
|
-
require 'addressfinder/
|
4
|
+
require 'addressfinder/verification'
|
5
5
|
require 'addressfinder/location_info'
|
6
6
|
require 'addressfinder/location_search'
|
7
7
|
require 'addressfinder/address_info'
|
@@ -28,8 +28,12 @@ module AddressFinder
|
|
28
28
|
@configuration ||= AddressFinder::Configuration.new
|
29
29
|
end
|
30
30
|
|
31
|
-
def cleanse(args={})
|
32
|
-
AddressFinder::
|
31
|
+
def cleanse(args={}) # We are keeping this method for backward compatibility
|
32
|
+
AddressFinder::Verification.new(args.merge(http: AddressFinder::HTTP.new(configuration))).perform.result
|
33
|
+
end
|
34
|
+
|
35
|
+
def verification(args={})
|
36
|
+
AddressFinder::Verification.new(args.merge(http: AddressFinder::HTTP.new(configuration))).perform.result
|
33
37
|
end
|
34
38
|
|
35
39
|
def location_search(args={})
|
data/lib/addressfinder/bulk.rb
CHANGED
@@ -21,7 +21,11 @@ module AddressFinder
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def cleanse(args={})
|
24
|
-
AddressFinder::
|
24
|
+
AddressFinder::Verification.new(args.merge(http: http)).perform.result
|
25
|
+
end
|
26
|
+
|
27
|
+
def verification(args={})
|
28
|
+
AddressFinder::Verification.new(args.merge(http: http)).perform.result
|
25
29
|
end
|
26
30
|
|
27
31
|
private
|
@@ -1,15 +1,16 @@
|
|
1
1
|
require 'ostruct'
|
2
2
|
|
3
3
|
module AddressFinder
|
4
|
-
class
|
4
|
+
class Verification
|
5
5
|
|
6
6
|
attr_reader :result
|
7
7
|
|
8
|
-
def initialize(q:, country: nil, delivered: nil, post_box: nil, rural: nil, region_code: nil, state_codes: nil, census: nil, domain: nil, key: nil, secret: nil, http:)
|
8
|
+
def initialize(q:, country: nil, delivered: nil, post_box: nil, paf: nil, rural: nil, region_code: nil, state_codes: nil, census: nil, domain: nil, key: nil, secret: nil, http:)
|
9
9
|
@params = {}
|
10
10
|
@params['q'] = q
|
11
11
|
@params['delivered'] = delivered if delivered
|
12
12
|
@params['post_box'] = post_box if post_box
|
13
|
+
@params['paf'] = paf if paf
|
13
14
|
@params['rural'] = rural if rural
|
14
15
|
@params['region_code'] = region_code if region_code
|
15
16
|
@params['state_codes'] = state_codes if state_codes
|
@@ -37,7 +38,7 @@ module AddressFinder
|
|
37
38
|
attr_writer :result
|
38
39
|
|
39
40
|
def build_request
|
40
|
-
@request_uri = "/api/#{country}/address/
|
41
|
+
@request_uri = "/api/#{country}/address/verification?#{encoded_params}"
|
41
42
|
end
|
42
43
|
|
43
44
|
def execute_request
|
@@ -28,9 +28,9 @@ RSpec.describe AddressFinder::Bulk do
|
|
28
28
|
let(:response){ double(:response, body: %Q({"success": true}), code: "200") }
|
29
29
|
let(:block){
|
30
30
|
Proc.new do |proxy|
|
31
|
-
proxy.
|
32
|
-
proxy.
|
33
|
-
proxy.
|
31
|
+
proxy.verification(q: "1 Willis")
|
32
|
+
proxy.verification(q: "2 Willis")
|
33
|
+
proxy.verification(q: "3 Willis")
|
34
34
|
end
|
35
35
|
}
|
36
36
|
|
@@ -53,5 +53,21 @@ RSpec.describe AddressFinder::Bulk do
|
|
53
53
|
AddressFinder::Bulk.new(http: http, &block).perform
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
context "with the deprecated cleanse method" do
|
58
|
+
let(:response){ double(:response, body: %Q({"success": true}), code: "200") }
|
59
|
+
let(:block){
|
60
|
+
Proc.new do |proxy|
|
61
|
+
proxy.cleanse(q: "1 Willis")
|
62
|
+
end
|
63
|
+
}
|
64
|
+
|
65
|
+
it "has the same behaviour as the verification method" do
|
66
|
+
expect(net_http).to receive(:do_start).once.and_call_original
|
67
|
+
expect(net_http).to receive(:transport_request).once.and_return(response)
|
68
|
+
expect(net_http).to receive(:do_finish).once.and_call_original
|
69
|
+
AddressFinder::Bulk.new(http: http, &block).perform
|
70
|
+
end
|
71
|
+
end
|
56
72
|
end
|
57
|
-
end
|
73
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
RSpec.describe AddressFinder::
|
3
|
+
RSpec.describe AddressFinder::Verification do
|
4
4
|
before do
|
5
5
|
AddressFinder.configure do |af|
|
6
6
|
af.api_key = 'XXX'
|
@@ -11,7 +11,7 @@ RSpec.describe AddressFinder::Cleanse do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
let(:
|
14
|
+
let(:verification_module){ AddressFinder::Verification.new(args) }
|
15
15
|
let(:http){ AddressFinder::HTTP.new(AddressFinder.configuration) }
|
16
16
|
let(:net_http){ http.send(:net_http) }
|
17
17
|
|
@@ -21,7 +21,7 @@ RSpec.describe AddressFinder::Cleanse do
|
|
21
21
|
before do
|
22
22
|
WebMock.allow_net_connect!(net_http_connect_on_start: true)
|
23
23
|
allow(http).to receive(:sleep)
|
24
|
-
allow(
|
24
|
+
allow(verification_module).to receive(:request_uri).and_return("/test/path")
|
25
25
|
expect(http).to_not receive(:re_establish_connection)
|
26
26
|
end
|
27
27
|
|
@@ -29,7 +29,7 @@ RSpec.describe AddressFinder::Cleanse do
|
|
29
29
|
WebMock.disable_net_connect!
|
30
30
|
end
|
31
31
|
|
32
|
-
subject(:execute_request){
|
32
|
+
subject(:execute_request){ verification_module.send(:execute_request) }
|
33
33
|
|
34
34
|
it "retries an errored request another time before succeeding" do
|
35
35
|
expect(net_http).to receive(:do_start).twice.and_call_original
|
@@ -62,60 +62,60 @@ RSpec.describe AddressFinder::Cleanse do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
describe '#build_request' do
|
65
|
-
subject(:request_uri){
|
65
|
+
subject(:request_uri){ verification_module.send(:build_request) }
|
66
66
|
|
67
67
|
context 'with minimal arguments' do
|
68
68
|
let(:args){ {q: '186 willis st', http: http} }
|
69
69
|
|
70
|
-
it { expect(request_uri).to eq('/api/nz/address/
|
70
|
+
it { expect(request_uri).to eq('/api/nz/address/verification?q=186+willis+st&format=json&key=XXX&secret=YYY') }
|
71
71
|
end
|
72
72
|
|
73
73
|
context 'with more arguments' do
|
74
|
-
let(:args){ {q: '186 willis st', delivered: true, region_code: 'A', census: '2013', http: http} }
|
74
|
+
let(:args){ {q: '186 willis st', delivered: true, region_code: 'A', paf: '1', census: '2013', http: http} }
|
75
75
|
|
76
|
-
it { expect(request_uri).to eq('/api/nz/address/
|
76
|
+
it { expect(request_uri).to eq('/api/nz/address/verification?q=186+willis+st&delivered=true&paf=1®ion_code=A&census=2013&format=json&key=XXX&secret=YYY') }
|
77
77
|
end
|
78
78
|
|
79
79
|
context 'with a country override' do
|
80
80
|
let(:args){ {q: '186 willis st', country: 'au', http: http} }
|
81
81
|
|
82
|
-
it { expect(request_uri).to eq('/api/au/address/
|
82
|
+
it { expect(request_uri).to eq('/api/au/address/verification?q=186+willis+st&format=json&key=XXX&secret=YYY') }
|
83
83
|
end
|
84
84
|
|
85
85
|
context 'with a state codes as an array' do
|
86
86
|
let(:args){ {q: '186 willis st', country: 'au', state_codes: ['ACT','NSW'], http: http} }
|
87
87
|
|
88
|
-
it { expect(request_uri).to eq('/api/au/address/
|
88
|
+
it { expect(request_uri).to eq('/api/au/address/verification?q=186+willis+st&state_codes[]=ACT&state_codes[]=NSW&format=json&key=XXX&secret=YYY') }
|
89
89
|
end
|
90
90
|
|
91
91
|
context 'with a reserved character in the query' do
|
92
92
|
let(:args){ {q: '186=willis st', country: 'au', state_codes: ['ACT','NSW'], http: http} }
|
93
93
|
|
94
|
-
it { expect(request_uri).to eq('/api/au/address/
|
94
|
+
it { expect(request_uri).to eq('/api/au/address/verification?q=186%3Dwillis+st&state_codes[]=ACT&state_codes[]=NSW&format=json&key=XXX&secret=YYY') }
|
95
95
|
end
|
96
96
|
|
97
97
|
context 'with a state codes as a string' do
|
98
98
|
let(:args){ {q: '186 willis st', country: 'au', state_codes: 'ACT,NSW', http: http} }
|
99
99
|
|
100
|
-
it { expect(request_uri).to eq('/api/au/address/
|
100
|
+
it { expect(request_uri).to eq('/api/au/address/verification?q=186+willis+st&state_codes=ACT%2CNSW&format=json&key=XXX&secret=YYY') }
|
101
101
|
end
|
102
102
|
|
103
103
|
context 'with a key override' do
|
104
104
|
let(:args){ {q: '186 willis st', key: 'AAA', http: http} }
|
105
105
|
|
106
|
-
it { expect(request_uri).to eq('/api/nz/address/
|
106
|
+
it { expect(request_uri).to eq('/api/nz/address/verification?q=186+willis+st&format=json&key=AAA&secret=YYY') }
|
107
107
|
end
|
108
108
|
|
109
109
|
context 'with a secret override' do
|
110
110
|
let(:args){ {q: '186 willis st', secret: 'BBB', http: http} }
|
111
111
|
|
112
|
-
it { expect(request_uri).to eq('/api/nz/address/
|
112
|
+
it { expect(request_uri).to eq('/api/nz/address/verification?q=186+willis+st&format=json&key=XXX&secret=BBB') }
|
113
113
|
end
|
114
114
|
|
115
115
|
context 'with a domain given' do
|
116
116
|
let(:args){ {q: '123', domain: 'testdomain.com', http: http} }
|
117
117
|
|
118
|
-
it { expect(request_uri).to eq('/api/nz/address/
|
118
|
+
it { expect(request_uri).to eq('/api/nz/address/verification?q=123&domain=testdomain.com&format=json&key=XXX&secret=YYY') }
|
119
119
|
|
120
120
|
context 'given in the AF configuration' do
|
121
121
|
|
@@ -123,7 +123,7 @@ RSpec.describe AddressFinder::Cleanse do
|
|
123
123
|
|
124
124
|
it 'should use the config domain if set' do
|
125
125
|
AddressFinder.configuration.domain = 'anotherdomain.com'
|
126
|
-
expect(request_uri).to eq('/api/nz/address/
|
126
|
+
expect(request_uri).to eq('/api/nz/address/verification?q=123&domain=anotherdomain.com&format=json&key=XXX&secret=YYY')
|
127
127
|
AddressFinder.configuration.domain = nil # set back to nil after
|
128
128
|
end
|
129
129
|
end
|
@@ -134,17 +134,17 @@ RSpec.describe AddressFinder::Cleanse do
|
|
134
134
|
let(:args){ {q: 'ignored', http: nil} }
|
135
135
|
|
136
136
|
before do
|
137
|
-
|
138
|
-
|
137
|
+
verification_module.send('response_body=', body)
|
138
|
+
verification_module.send('response_status=', status)
|
139
139
|
end
|
140
140
|
|
141
|
-
subject(:result){
|
141
|
+
subject(:result){ verification_module.send(:build_result) }
|
142
142
|
|
143
143
|
context 'with a successful nz result' do
|
144
144
|
let(:body){ '{"matched": true, "postal_address": "Texas"}' }
|
145
145
|
let(:status){ '200' }
|
146
146
|
|
147
|
-
it { expect(result.class).to eq(AddressFinder::
|
147
|
+
it { expect(result.class).to eq(AddressFinder::Verification::Result) }
|
148
148
|
|
149
149
|
it { expect(result.matched).to eq(true) }
|
150
150
|
|
@@ -155,7 +155,7 @@ RSpec.describe AddressFinder::Cleanse do
|
|
155
155
|
let(:body){ %Q({"matched": true, "success": true, "address": {"full_address": "Texas"}}) }
|
156
156
|
let(:status){ '200' }
|
157
157
|
|
158
|
-
it { expect(result.class).to eq(AddressFinder::
|
158
|
+
it { expect(result.class).to eq(AddressFinder::Verification::Result) }
|
159
159
|
|
160
160
|
it { expect(result.full_address).to eq("Texas") }
|
161
161
|
end
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: addressfinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nigel Ramsay
|
8
8
|
- Naiki Pohe
|
9
9
|
- Sean Arnold
|
10
10
|
- Alexandre Barret
|
11
|
+
- Cassandre Guinut
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date:
|
15
|
+
date: 2021-07-02 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: multi_json
|
@@ -99,10 +100,11 @@ dependencies:
|
|
99
100
|
version: '3.2'
|
100
101
|
description: Ruby client library for AddressFinder
|
101
102
|
email:
|
102
|
-
- nigel.ramsay@
|
103
|
+
- nigel.ramsay@addressfinder.nz
|
103
104
|
- naiki.pohe@abletech.co.nz
|
104
105
|
- seanarnie@gmail.com
|
105
106
|
- alex@abletech.nz
|
107
|
+
- cassandre.guinut@addressfinder.nz
|
106
108
|
executables: []
|
107
109
|
extensions: []
|
108
110
|
extra_rdoc_files: []
|
@@ -113,7 +115,7 @@ files:
|
|
113
115
|
- Dockerfile
|
114
116
|
- Gemfile
|
115
117
|
- Guardfile
|
116
|
-
- LICENSE
|
118
|
+
- LICENSE.md
|
117
119
|
- README.md
|
118
120
|
- Rakefile
|
119
121
|
- addressfinder.gemspec
|
@@ -123,24 +125,24 @@ files:
|
|
123
125
|
- lib/addressfinder/address_info.rb
|
124
126
|
- lib/addressfinder/address_search.rb
|
125
127
|
- lib/addressfinder/bulk.rb
|
126
|
-
- lib/addressfinder/cleanse.rb
|
127
128
|
- lib/addressfinder/configuration.rb
|
128
129
|
- lib/addressfinder/errors.rb
|
129
130
|
- lib/addressfinder/http.rb
|
130
131
|
- lib/addressfinder/location_info.rb
|
131
132
|
- lib/addressfinder/location_search.rb
|
132
133
|
- lib/addressfinder/util.rb
|
134
|
+
- lib/addressfinder/verification.rb
|
133
135
|
- lib/addressfinder/version.rb
|
134
136
|
- spec/lib/addressfinder/address_autocomplete_spec.rb
|
135
137
|
- spec/lib/addressfinder/address_info_spec.rb
|
136
138
|
- spec/lib/addressfinder/address_search_spec.rb
|
137
139
|
- spec/lib/addressfinder/bulk_spec.rb
|
138
|
-
- spec/lib/addressfinder/cleanse_spec.rb
|
139
140
|
- spec/lib/addressfinder/location_info_spec.rb
|
140
141
|
- spec/lib/addressfinder/location_search_spec.rb
|
141
142
|
- spec/lib/addressfinder/util_spec.rb
|
143
|
+
- spec/lib/addressfinder/verification_spec.rb
|
142
144
|
- spec/spec_helper.rb
|
143
|
-
homepage: https://github.com/
|
145
|
+
homepage: https://github.com/AddressFinder/addressfinder-ruby
|
144
146
|
licenses:
|
145
147
|
- MIT
|
146
148
|
metadata: {}
|
@@ -168,8 +170,8 @@ test_files:
|
|
168
170
|
- spec/lib/addressfinder/address_info_spec.rb
|
169
171
|
- spec/lib/addressfinder/address_search_spec.rb
|
170
172
|
- spec/lib/addressfinder/bulk_spec.rb
|
171
|
-
- spec/lib/addressfinder/cleanse_spec.rb
|
172
173
|
- spec/lib/addressfinder/location_info_spec.rb
|
173
174
|
- spec/lib/addressfinder/location_search_spec.rb
|
174
175
|
- spec/lib/addressfinder/util_spec.rb
|
176
|
+
- spec/lib/addressfinder/verification_spec.rb
|
175
177
|
- spec/spec_helper.rb
|
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2015 Abletech
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
22
|
-
|