smartystreets_ruby_sdk 0.0.0 → 1.0.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 +5 -5
- data/.gitignore +0 -1
- data/{LICENSE.md → LICENSE.txt} +1 -1
- data/Makefile +17 -31
- data/README.md +6 -9
- data/Rakefile +2 -5
- data/examples/us_street_multiple_address_example.rb +15 -40
- data/examples/us_street_single_address_example.rb +8 -32
- data/examples/us_zipcode_multiple_lookup_example.rb +9 -21
- data/examples/us_zipcode_single_lookup_example.rb +6 -18
- data/lib/smartystreets_ruby_sdk/batch.rb +38 -45
- data/lib/smartystreets_ruby_sdk/core_client_builder.rb +56 -0
- data/lib/smartystreets_ruby_sdk/custom_header_sender.rb +8 -10
- data/lib/smartystreets_ruby_sdk/errors.rb +11 -21
- data/lib/smartystreets_ruby_sdk/exceptions.rb +16 -27
- data/lib/smartystreets_ruby_sdk/json_able.rb +11 -13
- data/lib/smartystreets_ruby_sdk/match_type.rb +5 -0
- data/lib/smartystreets_ruby_sdk/native_sender.rb +43 -65
- data/lib/smartystreets_ruby_sdk/native_serializer.rb +7 -9
- data/lib/smartystreets_ruby_sdk/request.rb +8 -11
- data/lib/smartystreets_ruby_sdk/response.rb +7 -9
- data/lib/smartystreets_ruby_sdk/retry_sender.rb +26 -32
- data/lib/smartystreets_ruby_sdk/shared_credentials.rb +9 -11
- data/lib/smartystreets_ruby_sdk/signing_sender.rb +9 -11
- data/lib/smartystreets_ruby_sdk/sleeper.rb +3 -5
- data/lib/smartystreets_ruby_sdk/static_credentials.rb +9 -11
- data/lib/smartystreets_ruby_sdk/status_code_sender.rb +29 -33
- data/lib/smartystreets_ruby_sdk/url_prefix_sender.rb +9 -11
- data/lib/smartystreets_ruby_sdk/us_street/analysis.rb +16 -21
- data/lib/smartystreets_ruby_sdk/us_street/candidate.rb +19 -23
- data/lib/smartystreets_ruby_sdk/us_street/client.rb +47 -60
- data/lib/smartystreets_ruby_sdk/us_street/client_builder.rb +15 -0
- data/lib/smartystreets_ruby_sdk/us_street/components.rb +27 -32
- data/lib/smartystreets_ruby_sdk/us_street/lookup.rb +20 -27
- data/lib/smartystreets_ruby_sdk/us_street/metadata.rb +23 -27
- data/lib/smartystreets_ruby_sdk/us_street.rb +3 -5
- data/lib/smartystreets_ruby_sdk/us_zipcode/city.rb +8 -14
- data/lib/smartystreets_ruby_sdk/us_zipcode/client.rb +36 -51
- data/lib/smartystreets_ruby_sdk/us_zipcode/client_builder.rb +15 -0
- data/lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb +9 -16
- data/lib/smartystreets_ruby_sdk/us_zipcode/result.rb +30 -34
- data/lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb +14 -32
- data/lib/smartystreets_ruby_sdk/us_zipcode.rb +3 -5
- data/lib/smartystreets_ruby_sdk/version.rb +2 -2
- data/lib/smartystreets_ruby_sdk.rb +1 -30
- data/smartystreets_ruby_sdk.gemspec +12 -3
- metadata +15 -61
- data/.github/workflows/gem-publish.yml +0 -58
- data/CHANGELOG.md +0 -5
- data/Dockerfile +0 -10
- data/docker-compose.yml +0 -12
- data/examples/international_autocomplete_example.rb +0 -47
- data/examples/international_example.rb +0 -53
- data/examples/us_autocomplete_pro_example.rb +0 -56
- data/examples/us_extract_example.rb +0 -63
- data/examples/us_reverse_geo_example.rb +0 -47
- data/lib/smartystreets_ruby_sdk/client_builder.rb +0 -188
- data/lib/smartystreets_ruby_sdk/international_autocomplete/client.rb +0 -61
- data/lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb +0 -21
- data/lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb +0 -16
- data/lib/smartystreets_ruby_sdk/international_street/analysis.rb +0 -17
- data/lib/smartystreets_ruby_sdk/international_street/candidate.rb +0 -23
- data/lib/smartystreets_ruby_sdk/international_street/changes.rb +0 -15
- data/lib/smartystreets_ruby_sdk/international_street/client.rb +0 -63
- data/lib/smartystreets_ruby_sdk/international_street/components.rb +0 -58
- data/lib/smartystreets_ruby_sdk/international_street/language_mode.rb +0 -9
- data/lib/smartystreets_ruby_sdk/international_street/lookup.rb +0 -82
- data/lib/smartystreets_ruby_sdk/international_street/metadata.rb +0 -17
- data/lib/smartystreets_ruby_sdk/international_street/rootlevel.rb +0 -25
- data/lib/smartystreets_ruby_sdk/international_street.rb +0 -12
- data/lib/smartystreets_ruby_sdk/license_sender.rb +0 -15
- data/lib/smartystreets_ruby_sdk/logger.rb +0 -7
- data/lib/smartystreets_ruby_sdk/proxy.rb +0 -16
- data/lib/smartystreets_ruby_sdk/us_autocomplete/client.rb +0 -72
- data/lib/smartystreets_ruby_sdk/us_autocomplete/geolocation_type.rb +0 -9
- data/lib/smartystreets_ruby_sdk/us_autocomplete/lookup.rb +0 -38
- data/lib/smartystreets_ruby_sdk/us_autocomplete/suggestion.rb +0 -16
- data/lib/smartystreets_ruby_sdk/us_autocomplete.rb +0 -9
- data/lib/smartystreets_ruby_sdk/us_autocomplete_pro/client.rb +0 -78
- data/lib/smartystreets_ruby_sdk/us_autocomplete_pro/geolocation_type.rb +0 -8
- data/lib/smartystreets_ruby_sdk/us_autocomplete_pro/lookup.rb +0 -63
- data/lib/smartystreets_ruby_sdk/us_autocomplete_pro/suggestion.rb +0 -18
- data/lib/smartystreets_ruby_sdk/us_autocomplete_pro.rb +0 -10
- data/lib/smartystreets_ruby_sdk/us_extract/address.rb +0 -24
- data/lib/smartystreets_ruby_sdk/us_extract/client.rb +0 -49
- data/lib/smartystreets_ruby_sdk/us_extract/lookup.rb +0 -22
- data/lib/smartystreets_ruby_sdk/us_extract/metadata.rb +0 -17
- data/lib/smartystreets_ruby_sdk/us_extract/result.rb +0 -21
- data/lib/smartystreets_ruby_sdk/us_extract.rb +0 -10
- data/lib/smartystreets_ruby_sdk/us_reverse_geo/address.rb +0 -16
- data/lib/smartystreets_ruby_sdk/us_reverse_geo/client.rb +0 -38
- data/lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb +0 -25
- data/lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb +0 -21
- data/lib/smartystreets_ruby_sdk/us_reverse_geo/result.rb +0 -20
- data/lib/smartystreets_ruby_sdk/us_reverse_geo/us_reverse_geo_response.rb +0 -17
- data/lib/smartystreets_ruby_sdk/us_reverse_geo.rb +0 -12
- data/lib/smartystreets_ruby_sdk/us_street/match_type.rb +0 -10
- data/lib/smartystreets_ruby_sdk/us_zipcode/alternate_county.rb +0 -15
- data/ruby-sdk-demo.json +0 -354
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
require_relative './us_zipcode/city'
|
|
2
2
|
require_relative './us_zipcode/client'
|
|
3
|
+
require_relative './us_zipcode/client_builder'
|
|
3
4
|
require_relative './us_zipcode/lookup'
|
|
4
5
|
require_relative './us_zipcode/result'
|
|
5
6
|
require_relative './us_zipcode/zip_code'
|
|
6
|
-
require_relative './us_zipcode/alternate_county'
|
|
7
7
|
|
|
8
|
-
module
|
|
9
|
-
|
|
10
|
-
end
|
|
11
|
-
end
|
|
8
|
+
module USZipcode
|
|
9
|
+
end
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module
|
|
2
|
-
VERSION = '
|
|
1
|
+
module SmartystreetsRubySdk
|
|
2
|
+
VERSION = '1.0.0'
|
|
3
3
|
end
|
|
@@ -1,33 +1,4 @@
|
|
|
1
1
|
require 'smartystreets_ruby_sdk/version'
|
|
2
|
-
require 'smartystreets_ruby_sdk/logger'
|
|
3
|
-
require 'smartystreets_ruby_sdk/sleeper'
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
require 'smartystreets_ruby_sdk/client_builder'
|
|
7
|
-
require 'smartystreets_ruby_sdk/custom_header_sender'
|
|
8
|
-
require 'smartystreets_ruby_sdk/errors'
|
|
9
|
-
require 'smartystreets_ruby_sdk/exceptions'
|
|
10
|
-
require 'smartystreets_ruby_sdk/json_able'
|
|
11
|
-
require 'smartystreets_ruby_sdk/logger'
|
|
12
|
-
require 'smartystreets_ruby_sdk/native_sender'
|
|
13
|
-
require 'smartystreets_ruby_sdk/native_serializer'
|
|
14
|
-
require 'smartystreets_ruby_sdk/request'
|
|
15
|
-
require 'smartystreets_ruby_sdk/response'
|
|
16
|
-
require 'smartystreets_ruby_sdk/retry_sender'
|
|
17
|
-
require 'smartystreets_ruby_sdk/license_sender'
|
|
18
|
-
require 'smartystreets_ruby_sdk/shared_credentials'
|
|
19
|
-
require 'smartystreets_ruby_sdk/signing_sender'
|
|
20
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
|
21
|
-
require 'smartystreets_ruby_sdk/status_code_sender'
|
|
22
|
-
require 'smartystreets_ruby_sdk/url_prefix_sender'
|
|
23
|
-
|
|
24
|
-
require 'smartystreets_ruby_sdk/us_extract'
|
|
25
|
-
require 'smartystreets_ruby_sdk/us_street'
|
|
26
|
-
require 'smartystreets_ruby_sdk/us_zipcode'
|
|
27
|
-
require 'smartystreets_ruby_sdk/us_autocomplete'
|
|
28
|
-
require 'smartystreets_ruby_sdk/us_autocomplete_pro'
|
|
29
|
-
require 'smartystreets_ruby_sdk/international_street'
|
|
30
|
-
require 'smartystreets_ruby_sdk/us_reverse_geo'
|
|
31
|
-
|
|
32
|
-
module SmartyStreets
|
|
3
|
+
module SmartystreetsRubySdk
|
|
33
4
|
end
|
|
@@ -5,13 +5,22 @@ require 'smartystreets_ruby_sdk/version'
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'smartystreets_ruby_sdk'
|
|
8
|
-
spec.version =
|
|
8
|
+
spec.version = SmartystreetsRubySdk::VERSION
|
|
9
9
|
spec.authors = ['SmartyStreets SDK Team']
|
|
10
10
|
spec.license = 'Apache-2.0'
|
|
11
11
|
spec.email = ['support@smartystreets.com']
|
|
12
12
|
spec.summary = 'An official library for the SmartyStreets APIs'
|
|
13
13
|
spec.homepage = 'https://github.com/smartystreets/smartystreets-ruby-sdk'
|
|
14
14
|
|
|
15
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
17
|
+
if spec.respond_to?(:metadata)
|
|
18
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
19
|
+
else
|
|
20
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
|
21
|
+
'public gem pushes.'
|
|
22
|
+
end
|
|
23
|
+
|
|
15
24
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
16
25
|
f.match(%r{^(test|spec|features)/})
|
|
17
26
|
end
|
|
@@ -19,8 +28,8 @@ Gem::Specification.new do |spec|
|
|
|
19
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
20
29
|
spec.require_paths = ['lib']
|
|
21
30
|
|
|
22
|
-
spec.add_development_dependency 'bundler', '~>
|
|
23
|
-
spec.add_development_dependency 'rake', '~>
|
|
31
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
|
32
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
24
33
|
spec.add_development_dependency 'minitest', '~> 5.8', '>= 5.8.3'
|
|
25
34
|
spec.add_development_dependency 'simplecov', '~> 0.12.0'
|
|
26
35
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: smartystreets_ruby_sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SmartyStreets SDK Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-01-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -16,28 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: '1.13'
|
|
20
20
|
type: :development
|
|
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:
|
|
26
|
+
version: '1.13'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: '10.0'
|
|
34
34
|
type: :development
|
|
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:
|
|
40
|
+
version: '10.0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: minitest
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -79,52 +79,28 @@ executables: []
|
|
|
79
79
|
extensions: []
|
|
80
80
|
extra_rdoc_files: []
|
|
81
81
|
files:
|
|
82
|
-
- ".github/workflows/gem-publish.yml"
|
|
83
82
|
- ".gitignore"
|
|
84
|
-
- CHANGELOG.md
|
|
85
|
-
- Dockerfile
|
|
86
83
|
- Gemfile
|
|
87
|
-
- LICENSE.
|
|
84
|
+
- LICENSE.txt
|
|
88
85
|
- Makefile
|
|
89
86
|
- README.md
|
|
90
87
|
- Rakefile
|
|
91
88
|
- bin/console
|
|
92
89
|
- bin/setup
|
|
93
|
-
- docker-compose.yml
|
|
94
|
-
- examples/international_autocomplete_example.rb
|
|
95
|
-
- examples/international_example.rb
|
|
96
|
-
- examples/us_autocomplete_pro_example.rb
|
|
97
|
-
- examples/us_extract_example.rb
|
|
98
|
-
- examples/us_reverse_geo_example.rb
|
|
99
90
|
- examples/us_street_multiple_address_example.rb
|
|
100
91
|
- examples/us_street_single_address_example.rb
|
|
101
92
|
- examples/us_zipcode_multiple_lookup_example.rb
|
|
102
93
|
- examples/us_zipcode_single_lookup_example.rb
|
|
103
94
|
- lib/smartystreets_ruby_sdk.rb
|
|
104
95
|
- lib/smartystreets_ruby_sdk/batch.rb
|
|
105
|
-
- lib/smartystreets_ruby_sdk/
|
|
96
|
+
- lib/smartystreets_ruby_sdk/core_client_builder.rb
|
|
106
97
|
- lib/smartystreets_ruby_sdk/custom_header_sender.rb
|
|
107
98
|
- lib/smartystreets_ruby_sdk/errors.rb
|
|
108
99
|
- lib/smartystreets_ruby_sdk/exceptions.rb
|
|
109
|
-
- lib/smartystreets_ruby_sdk/international_autocomplete/client.rb
|
|
110
|
-
- lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb
|
|
111
|
-
- lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb
|
|
112
|
-
- lib/smartystreets_ruby_sdk/international_street.rb
|
|
113
|
-
- lib/smartystreets_ruby_sdk/international_street/analysis.rb
|
|
114
|
-
- lib/smartystreets_ruby_sdk/international_street/candidate.rb
|
|
115
|
-
- lib/smartystreets_ruby_sdk/international_street/changes.rb
|
|
116
|
-
- lib/smartystreets_ruby_sdk/international_street/client.rb
|
|
117
|
-
- lib/smartystreets_ruby_sdk/international_street/components.rb
|
|
118
|
-
- lib/smartystreets_ruby_sdk/international_street/language_mode.rb
|
|
119
|
-
- lib/smartystreets_ruby_sdk/international_street/lookup.rb
|
|
120
|
-
- lib/smartystreets_ruby_sdk/international_street/metadata.rb
|
|
121
|
-
- lib/smartystreets_ruby_sdk/international_street/rootlevel.rb
|
|
122
100
|
- lib/smartystreets_ruby_sdk/json_able.rb
|
|
123
|
-
- lib/smartystreets_ruby_sdk/
|
|
124
|
-
- lib/smartystreets_ruby_sdk/logger.rb
|
|
101
|
+
- lib/smartystreets_ruby_sdk/match_type.rb
|
|
125
102
|
- lib/smartystreets_ruby_sdk/native_sender.rb
|
|
126
103
|
- lib/smartystreets_ruby_sdk/native_serializer.rb
|
|
127
|
-
- lib/smartystreets_ruby_sdk/proxy.rb
|
|
128
104
|
- lib/smartystreets_ruby_sdk/request.rb
|
|
129
105
|
- lib/smartystreets_ruby_sdk/response.rb
|
|
130
106
|
- lib/smartystreets_ruby_sdk/retry_sender.rb
|
|
@@ -134,51 +110,28 @@ files:
|
|
|
134
110
|
- lib/smartystreets_ruby_sdk/static_credentials.rb
|
|
135
111
|
- lib/smartystreets_ruby_sdk/status_code_sender.rb
|
|
136
112
|
- lib/smartystreets_ruby_sdk/url_prefix_sender.rb
|
|
137
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete.rb
|
|
138
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete/client.rb
|
|
139
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete/geolocation_type.rb
|
|
140
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete/lookup.rb
|
|
141
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete/suggestion.rb
|
|
142
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete_pro.rb
|
|
143
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete_pro/client.rb
|
|
144
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete_pro/geolocation_type.rb
|
|
145
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete_pro/lookup.rb
|
|
146
|
-
- lib/smartystreets_ruby_sdk/us_autocomplete_pro/suggestion.rb
|
|
147
|
-
- lib/smartystreets_ruby_sdk/us_extract.rb
|
|
148
|
-
- lib/smartystreets_ruby_sdk/us_extract/address.rb
|
|
149
|
-
- lib/smartystreets_ruby_sdk/us_extract/client.rb
|
|
150
|
-
- lib/smartystreets_ruby_sdk/us_extract/lookup.rb
|
|
151
|
-
- lib/smartystreets_ruby_sdk/us_extract/metadata.rb
|
|
152
|
-
- lib/smartystreets_ruby_sdk/us_extract/result.rb
|
|
153
|
-
- lib/smartystreets_ruby_sdk/us_reverse_geo.rb
|
|
154
|
-
- lib/smartystreets_ruby_sdk/us_reverse_geo/address.rb
|
|
155
|
-
- lib/smartystreets_ruby_sdk/us_reverse_geo/client.rb
|
|
156
|
-
- lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb
|
|
157
|
-
- lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb
|
|
158
|
-
- lib/smartystreets_ruby_sdk/us_reverse_geo/result.rb
|
|
159
|
-
- lib/smartystreets_ruby_sdk/us_reverse_geo/us_reverse_geo_response.rb
|
|
160
113
|
- lib/smartystreets_ruby_sdk/us_street.rb
|
|
161
114
|
- lib/smartystreets_ruby_sdk/us_street/analysis.rb
|
|
162
115
|
- lib/smartystreets_ruby_sdk/us_street/candidate.rb
|
|
163
116
|
- lib/smartystreets_ruby_sdk/us_street/client.rb
|
|
117
|
+
- lib/smartystreets_ruby_sdk/us_street/client_builder.rb
|
|
164
118
|
- lib/smartystreets_ruby_sdk/us_street/components.rb
|
|
165
119
|
- lib/smartystreets_ruby_sdk/us_street/lookup.rb
|
|
166
|
-
- lib/smartystreets_ruby_sdk/us_street/match_type.rb
|
|
167
120
|
- lib/smartystreets_ruby_sdk/us_street/metadata.rb
|
|
168
121
|
- lib/smartystreets_ruby_sdk/us_zipcode.rb
|
|
169
|
-
- lib/smartystreets_ruby_sdk/us_zipcode/alternate_county.rb
|
|
170
122
|
- lib/smartystreets_ruby_sdk/us_zipcode/city.rb
|
|
171
123
|
- lib/smartystreets_ruby_sdk/us_zipcode/client.rb
|
|
124
|
+
- lib/smartystreets_ruby_sdk/us_zipcode/client_builder.rb
|
|
172
125
|
- lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb
|
|
173
126
|
- lib/smartystreets_ruby_sdk/us_zipcode/result.rb
|
|
174
127
|
- lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb
|
|
175
128
|
- lib/smartystreets_ruby_sdk/version.rb
|
|
176
|
-
- ruby-sdk-demo.json
|
|
177
129
|
- smartystreets_ruby_sdk.gemspec
|
|
178
130
|
homepage: https://github.com/smartystreets/smartystreets-ruby-sdk
|
|
179
131
|
licenses:
|
|
180
132
|
- Apache-2.0
|
|
181
|
-
metadata:
|
|
133
|
+
metadata:
|
|
134
|
+
allowed_push_host: https://rubygems.org
|
|
182
135
|
post_install_message:
|
|
183
136
|
rdoc_options: []
|
|
184
137
|
require_paths:
|
|
@@ -194,7 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
194
147
|
- !ruby/object:Gem::Version
|
|
195
148
|
version: '0'
|
|
196
149
|
requirements: []
|
|
197
|
-
|
|
150
|
+
rubyforge_project:
|
|
151
|
+
rubygems_version: 2.5.1
|
|
198
152
|
signing_key:
|
|
199
153
|
specification_version: 4
|
|
200
154
|
summary: An official library for the SmartyStreets APIs
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
name: Ruby Gem Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- '*'
|
|
7
|
-
jobs:
|
|
8
|
-
publish:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
env:
|
|
11
|
-
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v3
|
|
15
|
-
with:
|
|
16
|
-
fetch-depth: 0 # need all the commits
|
|
17
|
-
|
|
18
|
-
- uses: ruby/setup-ruby@v1
|
|
19
|
-
with:
|
|
20
|
-
ruby-version: '2.6'
|
|
21
|
-
bundler-cache: false
|
|
22
|
-
|
|
23
|
-
- uses: actions/setup-node@v2
|
|
24
|
-
|
|
25
|
-
- name: Clean
|
|
26
|
-
run: |
|
|
27
|
-
rm -f *.gem
|
|
28
|
-
git checkout lib/smartystreets_ruby_sdk/version.rb
|
|
29
|
-
|
|
30
|
-
- name: Dependencies
|
|
31
|
-
run: |
|
|
32
|
-
gem install minitest
|
|
33
|
-
|
|
34
|
-
- name: Test
|
|
35
|
-
run: |
|
|
36
|
-
rake test
|
|
37
|
-
|
|
38
|
-
- name: Set Environment Variable
|
|
39
|
-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
40
|
-
|
|
41
|
-
- name: Grab Version
|
|
42
|
-
run: |
|
|
43
|
-
echo "VERSION = \"${{ env.RELEASE_VERSION }}\"" >> version.rb \
|
|
44
|
-
&& cat version.rb \
|
|
45
|
-
# && gem build *.gemspec \
|
|
46
|
-
# && git checkout version.rb
|
|
47
|
-
|
|
48
|
-
- name: Push to rubygems.org
|
|
49
|
-
run: |
|
|
50
|
-
mkdir -p $HOME/.gem
|
|
51
|
-
touch $HOME/.gem/credentials
|
|
52
|
-
chmod 0600 $HOME/.gem/credentials
|
|
53
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
|
54
|
-
gem build *.gemspec
|
|
55
|
-
gem push *.gem
|
|
56
|
-
# chmod 0600 /root/.gem/credentials
|
|
57
|
-
env:
|
|
58
|
-
GEM_HOST_API_KEY: "${{secrets.GEM_HOST_API_KEY}}"
|
data/CHANGELOG.md
DELETED
data/Dockerfile
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
FROM ruby:alpine
|
|
2
|
-
|
|
3
|
-
COPY . /code
|
|
4
|
-
WORKDIR /code
|
|
5
|
-
|
|
6
|
-
RUN apk add -U make git && make dependencies \
|
|
7
|
-
&& wget -O - "https://github.com/smartystreets/version-tools/releases/download/0.0.6/release.tar.gz" | tar -xz -C /usr/local/bin/
|
|
8
|
-
|
|
9
|
-
ARG RUBYGEMS_API_KEY
|
|
10
|
-
RUN mkdir -p ~/.gem && umask 0277 && echo "${RUBYGEMS_API_KEY}" > ~/.gem/credentials
|
data/docker-compose.yml
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
require 'smartystreets_ruby_sdk/shared_credentials'
|
|
2
|
-
require '../lib/smartystreets_ruby_sdk/client_builder'
|
|
3
|
-
require '../lib/smartystreets_ruby_sdk/international_autocomplete/lookup'
|
|
4
|
-
require '../lib/smartystreets_ruby_sdk/international_autocomplete/client'
|
|
5
|
-
|
|
6
|
-
class InternationalAutocompleteExample
|
|
7
|
-
Lookup = SmartyStreets::InternationalAutocomplete::Lookup
|
|
8
|
-
|
|
9
|
-
def run
|
|
10
|
-
# key = 'Your SmartyStreets Auth ID here'
|
|
11
|
-
# hostname = 'Your SmartyStreets Auth Token here'
|
|
12
|
-
|
|
13
|
-
# We recommend storing your secret keys in environment variables instead---it's safer!
|
|
14
|
-
key = ENV['SMARTY_AUTH_WEB']
|
|
15
|
-
referer = ENV['SMARTY_AUTH_REFERER']
|
|
16
|
-
|
|
17
|
-
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
|
18
|
-
|
|
19
|
-
# The appropriate license values to be used for your subscriptions
|
|
20
|
-
# can be found on the Subscriptions page of the account dashboard.
|
|
21
|
-
# https://www.smartystreets.com/docs/cloud/licensing
|
|
22
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['international-autocomplete-cloud'])
|
|
23
|
-
.build_international_autocomplete_api_client
|
|
24
|
-
|
|
25
|
-
# Documentation for input fields can be found at:
|
|
26
|
-
# https://smartystreets.com/docs/cloud/us-autocomplete-api
|
|
27
|
-
|
|
28
|
-
lookup = Lookup.new('Louis')
|
|
29
|
-
lookup.country = "FRA"
|
|
30
|
-
lookup.locality = "Paris"
|
|
31
|
-
|
|
32
|
-
suggestions = client.send(lookup) # The client will also return the suggestions directly
|
|
33
|
-
|
|
34
|
-
puts
|
|
35
|
-
puts '*** Result with some filters ***'
|
|
36
|
-
puts
|
|
37
|
-
|
|
38
|
-
suggestions.each do |suggestion|
|
|
39
|
-
puts "#{suggestion.street} #{suggestion.locality}, #{suggestion.country_iso3}"
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
InternationalAutocompleteExample.new.run
|
|
46
|
-
|
|
47
|
-
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
|
2
|
-
require 'smartystreets_ruby_sdk/client_builder'
|
|
3
|
-
require 'smartystreets_ruby_sdk/international_street/lookup'
|
|
4
|
-
|
|
5
|
-
class InternationalExample
|
|
6
|
-
Lookup = SmartyStreets::InternationalStreet::Lookup
|
|
7
|
-
|
|
8
|
-
def run
|
|
9
|
-
# auth_id = 'Your SmartyStreets Auth ID here'
|
|
10
|
-
# auth_token = 'Your SmartyStreets Auth Token here'
|
|
11
|
-
|
|
12
|
-
# We recommend storing your secret keys in environment variables instead---it's safer!
|
|
13
|
-
auth_id = ENV['SMARTY_AUTH_ID']
|
|
14
|
-
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
|
15
|
-
|
|
16
|
-
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
|
17
|
-
|
|
18
|
-
# The appropriate license values to be used for your subscriptions
|
|
19
|
-
# can be found on the Subscriptions page of the account dashboard.
|
|
20
|
-
# https://www.smartystreets.com/docs/cloud/licensing
|
|
21
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['international-global-plus-cloud'])
|
|
22
|
-
.build_international_street_api_client
|
|
23
|
-
|
|
24
|
-
# Documentation for input fields can be found at:
|
|
25
|
-
# https://smartystreets.com/docs/cloud/international-street-api
|
|
26
|
-
|
|
27
|
-
lookup = Lookup.new()
|
|
28
|
-
lookup.inputId = 'ID-8675309' # Optional ID from your system
|
|
29
|
-
lookup.geocode = true # Must be expressly set to get latitude and longitude.
|
|
30
|
-
lookup.organization = 'John Doe'
|
|
31
|
-
lookup.address1 = "Rua Padre Antonio D'Angelo 121"
|
|
32
|
-
lookup.address2 = 'Casa Verde'
|
|
33
|
-
lookup.locality = 'Sao Paulo'
|
|
34
|
-
lookup.administrative_area = 'SP'
|
|
35
|
-
lookup.country = 'Brazil'
|
|
36
|
-
lookup.postal_code = '02516-050'
|
|
37
|
-
|
|
38
|
-
candidates = client.send(lookup) # The candidates are also stored in the lookup's 'result' field.
|
|
39
|
-
|
|
40
|
-
first_candidate = candidates[0]
|
|
41
|
-
puts "Input ID: #{first_candidate.input_id}"
|
|
42
|
-
puts "Address is #{first_candidate.analysis.verification_status}"
|
|
43
|
-
puts "Address precision: #{first_candidate.analysis.address_precision}\n\n"
|
|
44
|
-
puts "First Line: #{first_candidate.address1}"
|
|
45
|
-
puts "Second Line: #{first_candidate.address2}"
|
|
46
|
-
puts "Third Line: #{first_candidate.address3}"
|
|
47
|
-
puts "Fourth Line: #{first_candidate.address4}"
|
|
48
|
-
puts "Latitude: #{first_candidate.metadata.latitude}"
|
|
49
|
-
puts "Longitude: #{first_candidate.metadata.longitude}"
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
InternationalExample.new.run
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
require 'smartystreets_ruby_sdk/shared_credentials'
|
|
2
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
|
3
|
-
require '../lib/smartystreets_ruby_sdk/client_builder'
|
|
4
|
-
require '../lib/smartystreets_ruby_sdk/us_autocomplete_pro/lookup'
|
|
5
|
-
|
|
6
|
-
class USAutocompleteProExample
|
|
7
|
-
Lookup = SmartyStreets::USAutocompletePro::Lookup
|
|
8
|
-
|
|
9
|
-
def run
|
|
10
|
-
# key = 'Your SmartyStreets Auth ID here'
|
|
11
|
-
# hostname = 'Your SmartyStreets Auth Token here'
|
|
12
|
-
|
|
13
|
-
# We recommend storing your secret keys in environment variables instead---it's safer!
|
|
14
|
-
key = ENV['SMARTY_AUTH_WEB']
|
|
15
|
-
referer = ENV['SMARTY_AUTH_REFERER']
|
|
16
|
-
|
|
17
|
-
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
|
18
|
-
|
|
19
|
-
# auth_id = ENV['SMARTY_AUTH_ID']
|
|
20
|
-
# auth_token = ENV['SMARTY_AUTH_TOKEN']
|
|
21
|
-
#
|
|
22
|
-
# credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
|
23
|
-
|
|
24
|
-
# The appropriate license values to be used for your subscriptions
|
|
25
|
-
# can be found on the Subscriptions page of the account dashboard.
|
|
26
|
-
# https://www.smartystreets.com/docs/cloud/licensing
|
|
27
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-autocomplete-pro-cloud'])
|
|
28
|
-
.build_us_autocomplete_pro_api_client
|
|
29
|
-
|
|
30
|
-
# Documentation for input fields can be found at:
|
|
31
|
-
# https://smartystreets.com/docs/cloud/us-autocomplete-api
|
|
32
|
-
|
|
33
|
-
lookup = Lookup.new('1042 W Center')
|
|
34
|
-
lookup.add_state_filter('CO')
|
|
35
|
-
lookup.add_state_filter('UT')
|
|
36
|
-
lookup.add_city_filter('Denver')
|
|
37
|
-
lookup.add_city_filter('Orem')
|
|
38
|
-
lookup.max_results = 5
|
|
39
|
-
lookup.prefer_ratio = 3
|
|
40
|
-
lookup.source = "all"
|
|
41
|
-
|
|
42
|
-
suggestions = client.send(lookup) # The client will also return the suggestions directly
|
|
43
|
-
|
|
44
|
-
puts
|
|
45
|
-
puts '*** Result with some filters ***'
|
|
46
|
-
puts
|
|
47
|
-
|
|
48
|
-
suggestions.each do |suggestion|
|
|
49
|
-
puts "#{suggestion.street_line} #{suggestion.city}, #{suggestion.state}"
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
USAutocompleteProExample.new.run
|
|
56
|
-
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
|
2
|
-
require 'smartystreets_ruby_sdk/client_builder'
|
|
3
|
-
require 'smartystreets_ruby_sdk/us_extract/lookup'
|
|
4
|
-
|
|
5
|
-
class USExtractExample
|
|
6
|
-
Lookup = SmartyStreets::USExtract::Lookup
|
|
7
|
-
|
|
8
|
-
def run
|
|
9
|
-
# auth_id = 'Your SmartyStreets Auth ID here'
|
|
10
|
-
# auth_token = 'Your SmartyStreets Auth Token here'
|
|
11
|
-
|
|
12
|
-
# We recommend storing your secret keys in environment variables instead---it's safer!
|
|
13
|
-
auth_id = ENV['SMARTY_AUTH_ID']
|
|
14
|
-
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
|
15
|
-
|
|
16
|
-
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
|
17
|
-
|
|
18
|
-
client = SmartyStreets::ClientBuilder.new(credentials).build_us_extract_api_client
|
|
19
|
-
|
|
20
|
-
text = "Here is some text.\r\nMy address is 3785 Las Vegs Av." \
|
|
21
|
-
"\r\nLos Vegas, Nevada." \
|
|
22
|
-
"\r\nMeet me at 1 Rosedale Baltimore Maryland, not at 123 Phony Street, Boise Idaho."
|
|
23
|
-
|
|
24
|
-
# Documentation for input fields can be found at:
|
|
25
|
-
# https://smartystreets.com/docs/cloud/us-extract-api
|
|
26
|
-
|
|
27
|
-
lookup = Lookup.new(text)
|
|
28
|
-
lookup.aggressive = true
|
|
29
|
-
lookup.addresses_have_line_breaks = false
|
|
30
|
-
lookup.addresses_per_line = 2
|
|
31
|
-
|
|
32
|
-
result = client.send(lookup)
|
|
33
|
-
|
|
34
|
-
metadata = result.metadata
|
|
35
|
-
puts "Found #{metadata.address_count} addresses."
|
|
36
|
-
puts "#{metadata.verified_count} of them were valid."
|
|
37
|
-
puts
|
|
38
|
-
|
|
39
|
-
addresses = result.addresses
|
|
40
|
-
|
|
41
|
-
puts "Addresses: \r\n**********************\r\n"
|
|
42
|
-
addresses.each do |address|
|
|
43
|
-
puts "\"#{address.text}\"\n\n"
|
|
44
|
-
puts "Verified? #{address.verified}"
|
|
45
|
-
if address.candidates.any?
|
|
46
|
-
puts("\nMatches:")
|
|
47
|
-
|
|
48
|
-
address.candidates.each do |candidate|
|
|
49
|
-
puts candidate.delivery_line_1
|
|
50
|
-
puts candidate.last_line
|
|
51
|
-
puts
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
else
|
|
55
|
-
puts
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
puts "**********************\n"
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
USExtractExample.new.run
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
|
2
|
-
require '../lib/smartystreets_ruby_sdk/client_builder'
|
|
3
|
-
require '../lib/smartystreets_ruby_sdk/us_reverse_geo/lookup'
|
|
4
|
-
|
|
5
|
-
class USReverseGeoExample
|
|
6
|
-
Lookup = SmartyStreets::USReverseGeo::Lookup
|
|
7
|
-
|
|
8
|
-
def run
|
|
9
|
-
# auth_id = 'Your SmartyStreets Auth ID here'
|
|
10
|
-
# auth_token = 'Your SmartyStreets Auth Token here'
|
|
11
|
-
|
|
12
|
-
# We recommend storing your secret keys in environment variables instead---it's safer!
|
|
13
|
-
auth_id = ENV['SMARTY_AUTH_ID']
|
|
14
|
-
auth_token = ENV['SMARTY_AUTH_TOKEN']
|
|
15
|
-
|
|
16
|
-
credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
|
|
17
|
-
|
|
18
|
-
# The appropriate license values to be used for your subscriptions
|
|
19
|
-
# can be found on the Subscriptions page of the account dashboard.
|
|
20
|
-
# https://www.smartystreets.com/docs/cloud/licensing
|
|
21
|
-
client = SmartyStreets::ClientBuilder.new(credentials).with_licenses(['us-reverse-geocoding-cloud'])
|
|
22
|
-
.build_us_reverse_geo_api_client
|
|
23
|
-
|
|
24
|
-
# Documentation for input fields can be found at:
|
|
25
|
-
# https://smartystreets.com/docs/cloud/us-reverse-geo-api#http-request-input-fields
|
|
26
|
-
|
|
27
|
-
lookup = Lookup.new(40.111111, -111.111111)
|
|
28
|
-
|
|
29
|
-
response = client.send(lookup)
|
|
30
|
-
result = response.results[0]
|
|
31
|
-
|
|
32
|
-
coordinate = result.coordinate
|
|
33
|
-
puts "Latitude: #{coordinate.latitude}"
|
|
34
|
-
puts "Longitude: #{coordinate.longitude}\n"
|
|
35
|
-
|
|
36
|
-
puts "Distance: #{result.distance}\n"
|
|
37
|
-
|
|
38
|
-
address = result.address
|
|
39
|
-
puts "Street: #{address.street}"
|
|
40
|
-
puts "City: #{address.city}"
|
|
41
|
-
puts "State Abbreviation: #{address.state_abbreviation}"
|
|
42
|
-
puts "ZIP Code: #{address.zipcode}"
|
|
43
|
-
puts "License: #{coordinate.get_license}"
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
USReverseGeoExample.new.run
|