smartystreets_ruby_sdk 4.0.0 → 4.0.1

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.
data/README.md CHANGED
@@ -8,7 +8,7 @@ You may have noticed this page is curiously sparse. Don't panic, there's [docume
8
8
 
9
9
  ---
10
10
 
11
- [![asciicast](https://asciinema.org/a/122129.png)](https://asciinema.org/a/122129)
11
+ [![asciicast](https://asciinema.org/a/124457.png)](https://asciinema.org/a/124457)
12
12
 
13
13
  ---
14
14
 
@@ -8,7 +8,9 @@ class USStreetSingleAddressExample
8
8
  auth_token = ENV['SMARTY_AUTH_TOKEN']
9
9
  credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)
10
10
 
11
- client = SmartyStreets::ClientBuilder.new(credentials).build_us_street_api_client
11
+ client = SmartyStreets::ClientBuilder.new(credentials).
12
+ # with_proxy('localhost', 8080, 'proxyUser', 'proxyPassword'). # Uncomment this line to try it with a proxy
13
+ build_us_street_api_client
12
14
 
13
15
  lookup = SmartyStreets::USStreet::Lookup.new
14
16
  lookup.street = '1600 Amphitheatre Pkwy'
@@ -6,6 +6,7 @@ require_relative 'retry_sender'
6
6
  require_relative 'url_prefix_sender'
7
7
  require_relative 'sleeper'
8
8
  require_relative 'logger'
9
+ require_relative 'proxy'
9
10
  require_relative 'us_street/client'
10
11
  require_relative 'us_zipcode/client'
11
12
  require_relative 'us_extract/client'
@@ -79,8 +80,8 @@ module SmartyStreets
79
80
  # proxy is a Proxy object from this module.
80
81
  #
81
82
  # Returns self to accommodate method chaining.
82
- def with_proxy(proxy)
83
- @proxy = proxy
83
+ def with_proxy(host, port, username, password)
84
+ @proxy = SmartyStreets::Proxy.new(host, port, username, password)
84
85
  self
85
86
  end
86
87
 
@@ -1,3 +1,3 @@
1
1
  module SmartyStreets
2
- VERSION = '4.0.0' # DO NOT EDIT (this is updated by a build job when a new release is published)
2
+ VERSION = '4.0.1' # DO NOT EDIT (this is updated by a build job when a new release is published)
3
3
  end
data/ruby-sdk-demo.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "version": 1,
3
3
  "width": 100,
4
4
  "height": 45,
5
- "duration": 25.40302,
5
+ "duration": 21.834346,
6
6
  "command": null,
7
7
  "title": null,
8
8
  "env": {
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "stdout": [
13
13
  [
14
- 0.000875,
14
+ 0.00095,
15
15
  "\u001b[?1034hbash-3.2$ "
16
16
  ],
17
17
  [
@@ -19,159 +19,203 @@
19
19
  "g"
20
20
  ],
21
21
  [
22
- 0.096613,
22
+ 0.14488,
23
23
  "e"
24
24
  ],
25
25
  [
26
- 0.199543,
26
+ 0.175927,
27
27
  "m"
28
28
  ],
29
29
  [
30
- 0.120305,
30
+ 0.128232,
31
31
  " "
32
32
  ],
33
33
  [
34
- 0.360287,
34
+ 0.135528,
35
35
  "i"
36
36
  ],
37
37
  [
38
- 0.167696,
38
+ 0.11217,
39
39
  "n"
40
40
  ],
41
41
  [
42
- 0.119548,
42
+ 0.375507,
43
43
  "s"
44
44
  ],
45
45
  [
46
- 0.143402,
46
+ 0.135337,
47
47
  "t"
48
48
  ],
49
49
  [
50
- 0.096943,
50
+ 0.121159,
51
51
  "a"
52
52
  ],
53
53
  [
54
- 0.159451,
54
+ 0.183897,
55
55
  "l"
56
56
  ],
57
57
  [
58
- 0.152755,
58
+ 0.14409,
59
59
  "l"
60
60
  ],
61
61
  [
62
- 0.472194,
62
+ 0.393336,
63
63
  " "
64
64
  ],
65
65
  [
66
- 0.415625,
66
+ 0.50259,
67
67
  "s"
68
68
  ],
69
69
  [
70
- 0.128058,
70
+ 0.128145,
71
71
  "m"
72
72
  ],
73
73
  [
74
- 0.136152,
74
+ 0.135902,
75
75
  "a"
76
76
  ],
77
77
  [
78
- 0.263332,
78
+ 0.159904,
79
79
  "r"
80
80
  ],
81
81
  [
82
- 0.224605,
82
+ 0.207946,
83
83
  "t"
84
84
  ],
85
85
  [
86
- 0.44166,
86
+ 0.199214,
87
87
  "y"
88
88
  ],
89
89
  [
90
- 0.254094,
90
+ 0.160182,
91
91
  "s"
92
92
  ],
93
93
  [
94
- 0.127964,
94
+ 0.184664,
95
95
  "t"
96
96
  ],
97
97
  [
98
- 0.112037,
98
+ 0.071914,
99
99
  "r"
100
100
  ],
101
101
  [
102
- 0.256337,
102
+ 0.24962,
103
103
  "e"
104
104
  ],
105
105
  [
106
- 0.135907,
106
+ 0.150388,
107
107
  "e"
108
108
  ],
109
109
  [
110
- 0.271188,
110
+ 0.103991,
111
111
  "t"
112
112
  ],
113
113
  [
114
- 0.096752,
114
+ 0.367511,
115
115
  "s"
116
116
  ],
117
117
  [
118
- 0.543902,
118
+ 0.608296,
119
119
  "_"
120
120
  ],
121
121
  [
122
- 0.303509,
122
+ 0.31945,
123
123
  "r"
124
124
  ],
125
125
  [
126
- 0.208053,
126
+ 0.2168,
127
127
  "u"
128
128
  ],
129
129
  [
130
- 0.248442,
130
+ 0.367931,
131
131
  "b"
132
132
  ],
133
133
  [
134
- 0.263945,
134
+ 0.303857,
135
135
  "y"
136
136
  ],
137
137
  [
138
- 0.472192,
138
+ 0.720391,
139
139
  "_"
140
140
  ],
141
141
  [
142
- 0.583879,
142
+ 0.575703,
143
143
  "s"
144
144
  ],
145
145
  [
146
- 0.136072,
146
+ 0.111963,
147
147
  "d"
148
148
  ],
149
149
  [
150
- 0.335389,
150
+ 0.799985,
151
151
  "k"
152
152
  ],
153
153
  [
154
- 0.711499,
154
+ 0.935086,
155
155
  "\r\n"
156
156
  ],
157
157
  [
158
- 0.622611,
159
- "Successfully installed smartystreets_ruby_sdk-3.0.0\r\n"
158
+ 0.497465,
159
+ "Fetching: smartystreets_ruby_sdk-4.0.0.gem"
160
160
  ],
161
161
  [
162
- 0.112475,
163
- "Parsing documentation for smartystreets_ruby_sdk-3.0.0\r\n"
162
+ 4.7e-05,
163
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 8%)"
164
164
  ],
165
165
  [
166
- 0.233239,
167
- "Installing ri documentation for smartystreets_ruby_sdk-3.0.0\r\n"
166
+ 0.000132,
167
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 19%)"
168
168
  ],
169
169
  [
170
- 0.076259,
170
+ 0.000123,
171
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 29%)"
172
+ ],
173
+ [
174
+ 0.000941,
175
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 40%)"
176
+ ],
177
+ [
178
+ 0.002169,
179
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 51%)"
180
+ ],
181
+ [
182
+ 0.014076,
183
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 61%)"
184
+ ],
185
+ [
186
+ 0.000382,
187
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 72%)"
188
+ ],
189
+ [
190
+ 0.001468,
191
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 83%)"
192
+ ],
193
+ [
194
+ 0.001077,
195
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem ( 93%)"
196
+ ],
197
+ [
198
+ 0.000778,
199
+ "\rFetching: smartystreets_ruby_sdk-4.0.0.gem (100%)\rFetching: smartystreets_ruby_sdk-4.0.0.gem (100%)\r\n"
200
+ ],
201
+ [
202
+ 0.03245,
203
+ "Successfully installed smartystreets_ruby_sdk-4.0.0\r\n"
204
+ ],
205
+ [
206
+ 0.092602,
207
+ "Parsing documentation for smartystreets_ruby_sdk-4.0.0\r\n"
208
+ ],
209
+ [
210
+ 0.233087,
211
+ "Installing ri documentation for smartystreets_ruby_sdk-4.0.0\r\n"
212
+ ],
213
+ [
214
+ 0.091585,
171
215
  "Done installing documentation for smartystreets_ruby_sdk after 0 seconds\r\n1 gem installed\r\n"
172
216
  ],
173
217
  [
174
- 0.011916,
218
+ 0.015211,
175
219
  "bash-3.2$ "
176
220
  ],
177
221
  [
@@ -179,84 +223,64 @@
179
223
  "\r\n"
180
224
  ],
181
225
  [
182
- 4e-05,
226
+ 7e-05,
183
227
  "bash-3.2$ "
184
228
  ],
185
229
  [
186
- 0.144236,
230
+ 0.15999,
187
231
  "\r\n"
188
232
  ],
189
233
  [
190
- 3.9e-05,
234
+ 0.000102,
191
235
  "bash-3.2$ "
192
236
  ],
193
237
  [
194
- 0.305081,
238
+ 1.0,
195
239
  "c"
196
240
  ],
197
241
  [
198
- 0.103617,
242
+ 0.08051,
199
243
  "a"
200
244
  ],
201
245
  [
202
- 0.287387,
246
+ 0.191263,
203
247
  "t"
204
248
  ],
205
249
  [
206
- 0.960198,
250
+ 0.200297,
207
251
  " "
208
252
  ],
209
253
  [
210
- 1.0,
254
+ 0.159047,
211
255
  "e"
212
256
  ],
213
257
  [
214
- 0.503401,
258
+ 0.744749,
215
259
  "x"
216
260
  ],
217
261
  [
218
- 0.144016,
262
+ 0.287948,
219
263
  "a"
220
264
  ],
221
265
  [
222
- 0.320538,
266
+ 0.167355,
223
267
  "m"
224
268
  ],
225
269
  [
226
- 0.136119,
227
- "p"
228
- ],
229
- [
230
- 0.327256,
231
- "l"
232
- ],
233
- [
234
- 0.400419,
235
- "e"
236
- ],
237
- [
238
- 0.592251,
239
- "."
270
+ 0.247893,
271
+ "ple.rb "
240
272
  ],
241
273
  [
242
- 0.535542,
243
- "r"
244
- ],
245
- [
246
- 0.320377,
247
- "b"
248
- ],
249
- [
250
- 0.230569,
274
+ 0.871485,
251
275
  "\r\n"
252
276
  ],
253
277
  [
254
- 0.00306,
255
- "require 'smartystreets_ruby_sdk/client_builder'\r\nrequire 'smartystreets_ruby_sdk/static_credentials'\r\nrequire 'smartystreets_ruby_sdk/us_street'\r\n\r\n\r\nclass Example\r\n def run\r\n # This keypair will have been deleted by the time you are watching this video... \r\n auth_id = 'c4df4ec8-2be0-8ccc-8762-d899ce38d1db'\r\n auth_token = 'KXb5V3XlB537Fx3XIgaa'\r\n credentials = StaticCredentials.new(auth_id, auth_token)\r\n\r\n puts 'Step 0. Wire up the client with your keypair.'\r\n client = ClientBuilder.new(credentials).build_us_street_api_client\r\n\r\n puts 'Step 1. Make a lookup. (BTW, you can also send entire batches of lookups...)'\r\n lookup = USStreet::Lookup.new\r\n lookup.street = '1 Rosedale'\r\n lookup.lastline = 'Baltimore MD'\r\n lookup.candidates = 10\r\n\r\n puts 'Step 2. Send the lookup.'\r\n client.send_lookup(lookup)\r\n\r\n puts 'Step 3. Show the resulting candidate addresses:'\r\n lookup.result.each_with_index do |candidate, c|\r\n puts \"- #{c}: #{candidate.delivery_line_1}, #{candidat"
278
+ 0.002848,
279
+ "require 'smartystreets_ruby_sdk/client_builder'\r\nrequire 'smartystreets_ruby_sdk/static_credentials'\r\nrequire 'smartystreets_ruby_sdk/us_street'\r\n\r\n\r\nclass Example\r\n def run\r\n # This keypair will have been deleted by the time you are watching this video... \r\n auth_id = 'f2ad739f-1f49-c201-b770-4625c7f84fe4'\r\n auth_token = '4RK9lhEJ66Xt6ucDzbrU'\r\n credentials = SmartyStreets::StaticCredentials.new(auth_id, auth_token)\r\n\r\n puts 'Step 0. Wire up the client with your keypair.'\r\n client = SmartyStreets::ClientBuilder.new(credentials).build_us_street_api_client\r\n\r\n puts 'Step 1. Make a lookup. (BTW, you can also send entire batches of lookups...)'\r\n lookup = SmartyStreets::USStreet::Lookup.new\r\n lookup.street = '1 Rosedale'\r\n lookup.lastline = 'Baltimore MD'\r\n lookup.candidates = 10\r\n\r\n puts 'Step 2. Send the lookup.'\r\n client.send_lookup(lookup)\r\n\r\n puts 'Step 3. Show the resulting candidate addresses:'\r\n lookup.result.each_with_index do |candidate, c|\r\n puts \"- #"
256
280
  ],
257
281
  [
258
- 3e-05,
259
- "e.last_line}\\n\"\r\n end\r\n end\r\nend\r\n\r\nExample.new.run"
282
+ 3.1e-05,
283
+ "{c}: #{candidate.delivery_line_1}, #{candidate.last_line}\\n\"\r\n end\r\n end\r\nend\r\n\r\nExample.new.run"
260
284
  ],
261
285
  [
262
286
  0.000304,
@@ -267,23 +291,15 @@
267
291
  "\r\n"
268
292
  ],
269
293
  [
270
- 2.5e-05,
271
- "bash-3.2$ "
272
- ],
273
- [
274
- 0.14381,
275
- "\r\n"
276
- ],
277
- [
278
- 6.9e-05,
294
+ 0.000115,
279
295
  "bash-3.2$ "
280
296
  ],
281
297
  [
282
- 0.14446,
298
+ 0.167817,
283
299
  "\r\n"
284
300
  ],
285
301
  [
286
- 3.7e-05,
302
+ 0.000102,
287
303
  "bash-3.2$ "
288
304
  ],
289
305
  [
@@ -291,75 +307,47 @@
291
307
  "r"
292
308
  ],
293
309
  [
294
- 0.144148,
310
+ 0.160298,
295
311
  "u"
296
312
  ],
297
313
  [
298
- 0.183292,
314
+ 0.215638,
299
315
  "b"
300
316
  ],
301
317
  [
302
- 0.160194,
318
+ 0.152017,
303
319
  "y"
304
320
  ],
305
321
  [
306
- 0.143947,
322
+ 0.136009,
307
323
  " "
308
324
  ],
309
325
  [
310
- 0.223659,
326
+ 0.231998,
311
327
  "e"
312
328
  ],
313
329
  [
314
- 0.465012,
330
+ 0.399875,
315
331
  "x"
316
332
  ],
317
333
  [
318
- 0.135554,
319
- "a"
320
- ],
321
- [
322
- 0.21534,
323
- "m"
324
- ],
325
- [
326
- 0.112946,
327
- "p"
328
- ],
329
- [
330
- 0.217044,
331
- "l"
332
- ],
333
- [
334
- 0.614323,
335
- "e"
336
- ],
337
- [
338
- 0.648622,
339
- "."
340
- ],
341
- [
342
- 0.399935,
343
- "r"
344
- ],
345
- [
346
- 0.271424,
347
- "b"
334
+ 0.279121,
335
+ "ample.rb "
348
336
  ],
349
337
  [
350
- 0.687326,
338
+ 1.0,
351
339
  "\r\n"
352
340
  ],
353
341
  [
354
- 0.072413,
342
+ 0.075529,
355
343
  "Step 0. Wire up the client with your keypair.\r\nStep 1. Make a lookup. (BTW, you can also send entire batches of lookups...)\r\nStep 2. Send the lookup.\r\n"
356
344
  ],
357
345
  [
358
- 0.248917,
346
+ 0.247698,
359
347
  "Step 3. Show the resulting candidate addresses:\r\n- 0: 1 N Rosedale St, Baltimore MD 21229-3737\r\n- 1: 1 S Rosedale St, Baltimore MD 21229-3739\r\n"
360
348
  ],
361
349
  [
362
- 0.007523,
350
+ 0.00718,
363
351
  "bash-3.2$ "
364
352
  ]
365
353
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartystreets_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: