addressy 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b7134478da6b375e14274968c54728f7ecfcda31
4
+ data.tar.gz: f8ce505b1a266f20337fb947c73044cf9d6fc37f
5
+ SHA512:
6
+ metadata.gz: 06fec9ac90bc29169da9735bdf9dc3c3b8563c94e371169342f5f607046022f4e8fb9a4f2847701cd18bb3ebe602a3a5764798e0e2e2a8503121ffc8e51343ba
7
+ data.tar.gz: b194945d52be15ac2d9b11d745b0187d84bbd831e2574bf4e583d5815a4c954da2b242ca224b29cece42c8600bfbc25cc69a2bf16f4adabe13debc79efb8bf56
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 OpenArc
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.
@@ -0,0 +1,38 @@
1
+ ### Addressy
2
+
3
+ Addressy makes it easy to fetch real addresses for your testing/demoing needs.
4
+
5
+ #### Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'addressy'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install addressy
18
+
19
+ #### Usage
20
+
21
+ Fetch a number of US addresses:
22
+
23
+ Addressy::US.fetch(5) #=> [#<Addressy::Address:0x123 ...>, ...]
24
+
25
+ The Addressy::Address API:
26
+
27
+ address = Addressy::US.fetch(2).first
28
+
29
+ address.street #=> "123 Webfoot Walk"
30
+ address.city #=> "Duckburg"
31
+ address.state #=> "CA"
32
+ address.zip #=> "33333-2222"
33
+ address.country #=> "United States"
34
+
35
+ address.zip(:simple) #=> "33333"
36
+ address.state(:name) #=> "California"
37
+ address.full #=> "123 Webfoot Walk, Duckburg, CA 33333-2222,
38
+ United States"
@@ -0,0 +1,343 @@
1
+ ---
2
+ record_0:
3
+ Address: 1300 Minnesota Ave
4
+ City: Billings
5
+ State: MT
6
+ Zip: 59101-2649
7
+ Country: United States
8
+ record_1:
9
+ Address: 538 Mill Creek Rd
10
+ City: Livingston
11
+ State: MT
12
+ Zip: 59047-8709
13
+ Country: United States
14
+ record_2:
15
+ Address: PO BOX 130
16
+ City: Sunburst
17
+ State: MT
18
+ Zip: 59482-0130
19
+ Country: United States
20
+ record_3:
21
+ Address: 1271 Fas 470
22
+ City: Lindsay
23
+ State: MT
24
+ Zip: 59339-9615
25
+ Country: United States
26
+ record_4:
27
+ Address: PO BOX 109
28
+ City: Winnett
29
+ State: MT
30
+ Zip: 59087-0109
31
+ Country: United States
32
+ record_5:
33
+ Address: 628 Knight St
34
+ City: Helena
35
+ State: MT
36
+ Zip: 59601-2639
37
+ Country: United States
38
+ record_6:
39
+ Address: 8295 Highline Rd
40
+ City: Manhattan
41
+ State: MT
42
+ Zip: 59741-8548
43
+ Country: United States
44
+ record_7:
45
+ Address: 1310 Allendale Rd
46
+ City: Laurel
47
+ State: MT
48
+ Zip: 59044-8716
49
+ Country: United States
50
+ record_8:
51
+ Address: 14752 Brackett Creek Rd
52
+ City: Bozeman
53
+ State: MT
54
+ Zip: 59715-9607
55
+ Country: United States
56
+ record_9:
57
+ Address: PO BOX 276
58
+ City: Ennis
59
+ State: MT
60
+ Zip: 59729-0276
61
+ Country: United States
62
+ record_10:
63
+ Address: 8056 Valier Hwy
64
+ City: Valier
65
+ State: MT
66
+ Zip: 59486-5222
67
+ Country: United States
68
+ record_11:
69
+ Address: 528 Aurora St
70
+ City: Stedman
71
+ State: NC
72
+ Zip: 28391-9723
73
+ Country: United States
74
+ record_12:
75
+ Address: 551 Highway 9 N
76
+ City: Mill Spring
77
+ State: NC
78
+ Zip: 28756-8620
79
+ Country: United States
80
+ record_13:
81
+ Address: 5913 Fordland Dr
82
+ City: Raleigh
83
+ State: NC
84
+ Zip: 27606-4467
85
+ Country: United States
86
+ record_14:
87
+ Address: 5000 Ainsdale Dr
88
+ City: Matthews
89
+ State: NC
90
+ Zip: 28104-6890
91
+ Country: United States
92
+ record_15:
93
+ Address: 369 Saint Marys Rd
94
+ City: Hillsborough
95
+ State: NC
96
+ Zip: 27278-2522
97
+ Country: United States
98
+ record_16:
99
+ Address: 218 Laurel Ridge Rd
100
+ City: Asheville
101
+ State: NC
102
+ Zip: 28805-9700
103
+ Country: United States
104
+ record_17:
105
+ Address: 1601 E Dixon Blvd
106
+ City: Shelby
107
+ State: NC
108
+ Zip: 28152-6949
109
+ Country: United States
110
+ record_18:
111
+ Address: 410 W Geer St
112
+ City: Durham
113
+ State: NC
114
+ Zip: 27701-2114
115
+ Country: United States
116
+ record_19:
117
+ Address: 219 Williams St
118
+ City: Fayetteville
119
+ State: NC
120
+ Zip: 28301-5663
121
+ Country: United States
122
+ record_20:
123
+ Address: 2510 Raeford Rd
124
+ City: Fayetteville
125
+ State: NC
126
+ Zip: 28305-5118
127
+ Country: United States
128
+ record_21:
129
+ Address: 3622 Wiggins Rd
130
+ City: Spring Hope
131
+ State: NC
132
+ Zip: 27882-8846
133
+ Country: United States
134
+ record_22:
135
+ Address: 4819 Emperor Blvd Ste 400
136
+ City: Durham
137
+ State: NC
138
+ Zip: 27703-5420
139
+ Country: United States
140
+ record_23:
141
+ Address: 5925 Carnegie Blvd Ste 102
142
+ City: Charlotte
143
+ State: NC
144
+ Zip: 28209-4656
145
+ Country: United States
146
+ record_24:
147
+ Address: 154 Pine Grove Ave
148
+ City: Rochester
149
+ State: NY
150
+ Zip: 14617-2627
151
+ Country: United States
152
+ record_25:
153
+ Address: 8 Maple Grv
154
+ City: New Berlin
155
+ State: NY
156
+ Zip: '13411'
157
+ Country: United States
158
+ record_26:
159
+ Address: 311 Route 32
160
+ City: Newburgh
161
+ State: NY
162
+ Zip: 12550-8856
163
+ Country: United States
164
+ record_27:
165
+ Address: 220 Plandome Rd
166
+ City: Manhasset
167
+ State: NY
168
+ Zip: 11030-2327
169
+ Country: United States
170
+ record_28:
171
+ Address: 6 E 32nd St Fl 5
172
+ City: New York
173
+ State: NY
174
+ Zip: 10016-5422
175
+ Country: United States
176
+ record_29:
177
+ Address: 2792 County Road 10
178
+ City: Canandaigua
179
+ State: NY
180
+ Zip: 14424-9536
181
+ Country: United States
182
+ record_30:
183
+ Address: PO BOX 517
184
+ City: Cornwall On Hudson
185
+ State: NY
186
+ Zip: 12520-0517
187
+ Country: United States
188
+ record_31:
189
+ Address: 41 Bethune St
190
+ City: New York
191
+ State: NY
192
+ Zip: 10014-1724
193
+ Country: United States
194
+ record_32:
195
+ Address: 6803 Manlius Center Rd
196
+ City: East Syracuse
197
+ State: NY
198
+ Zip: 13057-3912
199
+ Country: United States
200
+ record_33:
201
+ Address: 100 Crossways Park Dr W Ste 217
202
+ City: Woodbury
203
+ State: NY
204
+ Zip: 11797-2012
205
+ Country: United States
206
+ record_34:
207
+ Address: 59 5th Ave
208
+ City: New York
209
+ State: NY
210
+ Zip: 10003-4349
211
+ Country: United States
212
+ record_35:
213
+ Address: 3000 Wakefield Crossing Dr
214
+ City: Raleigh
215
+ State: NC
216
+ Zip: 27614-7076
217
+ Country: United States
218
+ record_36:
219
+ Address: 1100 S Stratford Rd
220
+ City: Winston Salem
221
+ State: NC
222
+ Zip: 27103-3217
223
+ Country: United States
224
+ record_37:
225
+ Address: 3980 Gum Branch Rd
226
+ City: Jacksonville
227
+ State: NC
228
+ Zip: 28540-4075
229
+ Country: United States
230
+ record_38:
231
+ Address: 401 W Monroe St
232
+ City: Salisbury
233
+ State: NC
234
+ Zip: 28144-5329
235
+ Country: United States
236
+ record_39:
237
+ Address: 5605 77 Center Dr Ste 285
238
+ City: Charlotte
239
+ State: NC
240
+ Zip: 28217-2751
241
+ Country: United States
242
+ record_40:
243
+ Address: 5605 77 Center Dr Ste 285
244
+ City: Charlotte
245
+ State: NC
246
+ Zip: 28217-2751
247
+ Country: United States
248
+ record_41:
249
+ Address: PO BOX 411225
250
+ City: Charlotte
251
+ State: NC
252
+ Zip: 28241-1225
253
+ Country: United States
254
+ record_42:
255
+ Address: 609 School St
256
+ City: Walnut Cove
257
+ State: NC
258
+ Zip: 27052-7682
259
+ Country: United States
260
+ record_43:
261
+ Address: 2430 2nd Ave SW
262
+ City: Hickory
263
+ State: NC
264
+ Zip: 28602-2047
265
+ Country: United States
266
+ record_44:
267
+ Address: 2100 Buffaloe Rd
268
+ City: Garner
269
+ State: NC
270
+ Zip: 27529-5161
271
+ Country: United States
272
+ record_45:
273
+ Address: 765 N Hamilton Rd Ste 120
274
+ City: Columbus
275
+ State: OH
276
+ Zip: 43230-8707
277
+ Country: United States
278
+ record_46:
279
+ Address: 4723 Cornell Rd
280
+ City: Cincinnati
281
+ State: OH
282
+ Zip: 45241-7406
283
+ Country: United States
284
+ record_47:
285
+ Address: 2527 W Broad St
286
+ City: Columbus
287
+ State: OH
288
+ Zip: 43204-3322
289
+ Country: United States
290
+ record_48:
291
+ Address: 10506 Montgomery Rd Ste 303
292
+ City: Cincinnati
293
+ State: OH
294
+ Zip: 45242-4400
295
+ Country: United States
296
+ record_49:
297
+ Address: 1245 Glen Dr
298
+ City: Millersburg
299
+ State: OH
300
+ Zip: 44654-8958
301
+ Country: United States
302
+ record_50:
303
+ Address: 718 E 3rd St Ste C
304
+ City: Salem
305
+ State: OH
306
+ Zip: 44460-2915
307
+ Country: United States
308
+ record_51:
309
+ Address: 7642 Production Dr
310
+ City: Cincinnati
311
+ State: OH
312
+ Zip: 45237-3209
313
+ Country: United States
314
+ record_52:
315
+ Address: 4270 Ivy Pointe Blvd 220
316
+ City: Cincinnati
317
+ State: OH
318
+ Zip: 45245-0001
319
+ Country: United States
320
+ record_53:
321
+ Address: 8324 N Main St
322
+ City: Dayton
323
+ State: OH
324
+ Zip: 45415-1601
325
+ Country: United States
326
+ record_54:
327
+ Address: 415 Glensprings Dr Ste 305
328
+ City: Cincinnati
329
+ State: OH
330
+ Zip: 45246-2354
331
+ Country: United States
332
+ record_55:
333
+ Address: 3983 Rosslyn Dr
334
+ City: Cincinnati
335
+ State: OH
336
+ Zip: 45209-1185
337
+ Country: United States
338
+ record_56:
339
+ Address: 295 Lancaster Ave
340
+ City: Reynoldsburg
341
+ State: OH
342
+ Zip: 43068-1192
343
+ Country: United States
@@ -0,0 +1,41 @@
1
+ require "addressy/version"
2
+ require "addressy/helper"
3
+ require "yaml"
4
+
5
+ ADDRESSES = YAML.load_file("#{File.expand_path(File.dirname(__FILE__))}/../data/addresses.yml").values
6
+
7
+ module Addressy
8
+ module US
9
+ def self.fetch(n, opts = {})
10
+ ADDRESSES.sample(n).map do |info|
11
+ Address.new(info)
12
+ end
13
+ end
14
+ end
15
+
16
+ class Address
17
+ attr_reader :street, :city, :country
18
+
19
+ def initialize(info)
20
+ @street = info.fetch("Address")
21
+ @city = info.fetch("City")
22
+ @state = info.fetch("State")
23
+ @zip = info.fetch("Zip")
24
+ @country = info.fetch("Country")
25
+ end
26
+
27
+ def state(name = false)
28
+ name ? ::Addressy::US::Helper::STATES[@state] : @state
29
+ end
30
+
31
+ def zip(simple = false)
32
+ simple ? @zip[0..4] : @zip
33
+ end
34
+
35
+ def full
36
+ "#{@street}, #{@city}, #{@state} #{@zip}, #{@country}"
37
+ end
38
+
39
+ alias_method :to_s, :full
40
+ end
41
+ end
@@ -0,0 +1,66 @@
1
+ module Addressy
2
+ module US
3
+ module Helper
4
+ STATES = {
5
+ 'AL' => 'Alabama',
6
+ 'AK' => 'Alaska',
7
+ 'AS' => 'America Samoa',
8
+ 'AZ' => 'Arizona',
9
+ 'AR' => 'Arkansas',
10
+ 'CA' => 'California',
11
+ 'CO' => 'Colorado',
12
+ 'CT' => 'Connecticut',
13
+ 'DE' => 'Delaware',
14
+ 'DC' => 'District of Columbia',
15
+ 'FM' => 'Micronesia1',
16
+ 'FL' => 'Florida',
17
+ 'GA' => 'Georgia',
18
+ 'GU' => 'Guam',
19
+ 'HI' => 'Hawaii',
20
+ 'ID' => 'Idaho',
21
+ 'IL' => 'Illinois',
22
+ 'IN' => 'Indiana',
23
+ 'IA' => 'Iowa',
24
+ 'KS' => 'Kansas',
25
+ 'KY' => 'Kentucky',
26
+ 'LA' => 'Louisiana',
27
+ 'ME' => 'Maine',
28
+ 'MH' => 'Islands1',
29
+ 'MD' => 'Maryland',
30
+ 'MA' => 'Massachusetts',
31
+ 'MI' => 'Michigan',
32
+ 'MN' => 'Minnesota',
33
+ 'MS' => 'Mississippi',
34
+ 'MO' => 'Missouri',
35
+ 'MT' => 'Montana',
36
+ 'NE' => 'Nebraska',
37
+ 'NV' => 'Nevada',
38
+ 'NH' => 'New Hampshire',
39
+ 'NJ' => 'New Jersey',
40
+ 'NM' => 'New Mexico',
41
+ 'NY' => 'New York',
42
+ 'NC' => 'North Carolina',
43
+ 'ND' => 'North Dakota',
44
+ 'OH' => 'Ohio',
45
+ 'OK' => 'Oklahoma',
46
+ 'OR' => 'Oregon',
47
+ 'PW' => 'Palau',
48
+ 'PA' => 'Pennsylvania',
49
+ 'PR' => 'Puerto Rico',
50
+ 'RI' => 'Rhode Island',
51
+ 'SC' => 'South Carolina',
52
+ 'SD' => 'South Dakota',
53
+ 'TN' => 'Tennessee',
54
+ 'TX' => 'Texas',
55
+ 'UT' => 'Utah',
56
+ 'VT' => 'Vermont',
57
+ 'VI' => 'Virgin Island',
58
+ 'VA' => 'Virginia',
59
+ 'WA' => 'Washington',
60
+ 'WV' => 'West Virginia',
61
+ 'WI' => 'Wisconsin',
62
+ 'WY' => 'Wyoming'
63
+ }
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,3 @@
1
+ module Addressy
2
+ VERSION = "0.0.2"
3
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: addressy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - OpenArc
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Real addresses for your testing/demoing needs.
56
+ email:
57
+ - travis@openarc.net
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - LICENSE.txt
63
+ - README.md
64
+ - data/addresses.yml
65
+ - lib/addressy.rb
66
+ - lib/addressy/helper.rb
67
+ - lib/addressy/version.rb
68
+ homepage: ''
69
+ licenses:
70
+ - MIT
71
+ metadata: {}
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ - data
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.2.2
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Real addresses for your testing/demoing needs.
93
+ test_files: []