sevenwire-forgery 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/README.markdown +81 -0
  2. data/VERSION.yml +4 -0
  3. data/generators/forgery/USAGE +6 -0
  4. data/generators/forgery/forgery_generator.rb +12 -0
  5. data/lib/dictionaries/cities +478 -0
  6. data/lib/dictionaries/colors +19 -0
  7. data/lib/dictionaries/company_names +400 -0
  8. data/lib/dictionaries/countries +249 -0
  9. data/lib/dictionaries/female_first_names +100 -0
  10. data/lib/dictionaries/frequencies +8 -0
  11. data/lib/dictionaries/genders +2 -0
  12. data/lib/dictionaries/languages +97 -0
  13. data/lib/dictionaries/last_names +250 -0
  14. data/lib/dictionaries/lorem_ipsum +151 -0
  15. data/lib/dictionaries/male_first_names +100 -0
  16. data/lib/dictionaries/name_suffixes +5 -0
  17. data/lib/dictionaries/name_titles +6 -0
  18. data/lib/dictionaries/races +93 -0
  19. data/lib/dictionaries/shirt_sizes +7 -0
  20. data/lib/dictionaries/state_abbrevs +50 -0
  21. data/lib/dictionaries/states +50 -0
  22. data/lib/dictionaries/street_suffixes +21 -0
  23. data/lib/dictionaries/streets +500 -0
  24. data/lib/dictionaries/top_level_domains +9 -0
  25. data/lib/extensions/array.rb +11 -0
  26. data/lib/extensions/hash.rb +12 -0
  27. data/lib/extensions/range.rb +9 -0
  28. data/lib/extensions/string.rb +48 -0
  29. data/lib/forgeries/address_forgery.rb +117 -0
  30. data/lib/forgeries/basic_forgery.rb +73 -0
  31. data/lib/forgeries/internet_forgery.rb +19 -0
  32. data/lib/forgeries/lorem_ipsum_forgery.rb +107 -0
  33. data/lib/forgeries/monetary_forgery.rb +13 -0
  34. data/lib/forgeries/name_forgery.rb +36 -0
  35. data/lib/forgeries/personal_forgery.rb +23 -0
  36. data/lib/forgery.rb +82 -0
  37. data/lib/formats/phone +1 -0
  38. data/lib/formats/street_number +5 -0
  39. data/lib/formats/zip +2 -0
  40. data/spec/extensions/array_spec.rb +25 -0
  41. data/spec/extensions/range_spec.rb +17 -0
  42. data/spec/extensions/string_spec.rb +29 -0
  43. data/spec/forgeries/address_forgery_spec.rb +69 -0
  44. data/spec/forgeries/basic_forgery_spec.rb +175 -0
  45. data/spec/forgeries/internet_forgery_spec.rb +30 -0
  46. data/spec/forgeries/lorem_ipsum_forgery_spec.rb +128 -0
  47. data/spec/forgeries/monetary_forgery_spec.rb +4 -0
  48. data/spec/forgeries/name_forgery_spec.rb +4 -0
  49. data/spec/forgeries/personal_forgery_spec.rb +15 -0
  50. data/spec/forgery_spec.rb +36 -0
  51. data/spec/spec_helper.rb +31 -0
  52. metadata +110 -0
@@ -0,0 +1,50 @@
1
+ AL
2
+ AK
3
+ AZ
4
+ AR
5
+ CA
6
+ CO
7
+ CT
8
+ DE
9
+ FL
10
+ GA
11
+ HI
12
+ ID
13
+ IL
14
+ IN
15
+ IA
16
+ KS
17
+ KY
18
+ LA
19
+ ME
20
+ MD
21
+ MA
22
+ MI
23
+ MN
24
+ MS
25
+ MO
26
+ MT
27
+ NE
28
+ NV
29
+ NH
30
+ NJ
31
+ NM
32
+ NY
33
+ NC
34
+ ND
35
+ OH
36
+ OK
37
+ OR
38
+ PA
39
+ RI
40
+ SC
41
+ SD
42
+ TN
43
+ TX
44
+ UT
45
+ VT
46
+ VA
47
+ WA
48
+ WV
49
+ WI
50
+ WY
@@ -0,0 +1,50 @@
1
+ Alabama
2
+ Alaska
3
+ Arizona
4
+ Arkansas
5
+ California
6
+ Colorado
7
+ Connecticut
8
+ Delaware
9
+ Florida
10
+ Georgia
11
+ Hawaii
12
+ Idaho
13
+ Illinois
14
+ Indiana
15
+ Iowa
16
+ Kansas
17
+ Kentucky
18
+ Louisiana
19
+ Maine
20
+ Maryland
21
+ Massachusetts
22
+ Michigan
23
+ Minnesota
24
+ Mississippi
25
+ Missouri
26
+ Montana
27
+ Nebraska
28
+ Nevada
29
+ New Hampshire
30
+ New Jersey
31
+ New Mexico
32
+ New York
33
+ North Carolina
34
+ North Dakota
35
+ Ohio
36
+ Oklahoma
37
+ Oregon
38
+ Pennsylvania
39
+ Rhode Island
40
+ South Carolina
41
+ South Dakota
42
+ Tennessee
43
+ Texas
44
+ Utah
45
+ Vermont
46
+ Virginia
47
+ Washington
48
+ West Virginia
49
+ Wisconsin
50
+ Wyoming
@@ -0,0 +1,21 @@
1
+ Alley
2
+ Avenue
3
+ Center
4
+ Circle
5
+ Court
6
+ Crossing
7
+ Drive
8
+ Hill
9
+ Junction
10
+ Lane
11
+ Park
12
+ Parkway
13
+ Pass
14
+ Place
15
+ Plaza
16
+ Point
17
+ Road
18
+ Street
19
+ Terrace
20
+ Trail
21
+ Way
@@ -0,0 +1,500 @@
1
+ 1st
2
+ 2nd
3
+ 3rd
4
+ 4th
5
+ 5th
6
+ 6th
7
+ 7th
8
+ 8th
9
+ Aberg
10
+ Acker
11
+ Algoma
12
+ Almo
13
+ Alpine
14
+ American
15
+ American Ash
16
+ Amoth
17
+ Anderson
18
+ Anhalt
19
+ Annamark
20
+ Anniversary
21
+ Anthes
22
+ Anzinger
23
+ Arapahoe
24
+ Arizona
25
+ Arkansas
26
+ Armistice
27
+ Arrowood
28
+ Artisan
29
+ Atwood
30
+ Autumn Leaf
31
+ Badeau
32
+ Banding
33
+ Barby
34
+ Barnett
35
+ Bartelt
36
+ Bartillon
37
+ Bashford
38
+ Basil
39
+ Bay
40
+ Bayside
41
+ Becker
42
+ Beilfuss
43
+ Bellgrove
44
+ Birchwood
45
+ Blackbird
46
+ Blaine
47
+ Blue Bill Park
48
+ Bluejay
49
+ Bluestem
50
+ Bobwhite
51
+ Bonner
52
+ Bowman
53
+ Boyd
54
+ Brentwood
55
+ Briar Crest
56
+ Brickson Park
57
+ Brown
58
+ Browning
59
+ Buell
60
+ Buena Vista
61
+ Buhler
62
+ Bultman
63
+ Bunker Hill
64
+ Bunting
65
+ Burning Wood
66
+ Burrows
67
+ Butterfield
68
+ Butternut
69
+ Caliangt
70
+ Calypso
71
+ Cambridge
72
+ Canary
73
+ Carberry
74
+ Cardinal
75
+ Carey
76
+ Carioca
77
+ Carpenter
78
+ Cascade
79
+ Center
80
+ Charing Cross
81
+ Cherokee
82
+ Chinook
83
+ Chive
84
+ Claremont
85
+ Clarendon
86
+ Clemons
87
+ Clove
88
+ Clyde Gallagher
89
+ Cody
90
+ Coleman
91
+ Colorado
92
+ Columbus
93
+ Comanche
94
+ Commercial
95
+ Continental
96
+ Coolidge
97
+ Corben
98
+ Cordelia
99
+ Corry
100
+ Corscot
101
+ Cottonwood
102
+ Crescent Oaks
103
+ Crest Line
104
+ Crowley
105
+ Crownhardt
106
+ Dahle
107
+ Dakota
108
+ Dapin
109
+ Darwin
110
+ David
111
+ Dawn
112
+ Daystar
113
+ Dayton
114
+ Debra
115
+ Debs
116
+ Declaration
117
+ Del Mar
118
+ Del Sol
119
+ Delaware
120
+ Delladonna
121
+ Dennis
122
+ Derek
123
+ Dexter
124
+ Di Loreto
125
+ Division
126
+ Dixon
127
+ Doe Crossing
128
+ Donald
129
+ Dorton
130
+ Dottie
131
+ Dovetail
132
+ Drewry
133
+ Dryden
134
+ Duke
135
+ Dunning
136
+ Dwight
137
+ Eagan
138
+ Eagle Crest
139
+ East
140
+ Eastlawn
141
+ Eastwood
142
+ Eggendart
143
+ Elgar
144
+ Eliot
145
+ Elka
146
+ Elmside
147
+ Emmet
148
+ Erie
149
+ Esch
150
+ Esker
151
+ Everett
152
+ Evergreen
153
+ Express
154
+ Fair Oaks
155
+ Fairfield
156
+ Fairview
157
+ Fallview
158
+ Farmco
159
+ Farragut
160
+ Farwell
161
+ Fieldstone
162
+ Fisk
163
+ Florence
164
+ Fordem
165
+ Forest
166
+ Forest Dale
167
+ Forest Run
168
+ Forster
169
+ Fremont
170
+ Fuller
171
+ Fulton
172
+ Gale
173
+ Garrison
174
+ Gateway
175
+ Gerald
176
+ Gina
177
+ Glacier Hill
178
+ Glendale
179
+ Golden Leaf
180
+ Golf
181
+ Golf Course
182
+ Golf View
183
+ Goodland
184
+ Graceland
185
+ Graedel
186
+ Granby
187
+ Grasskamp
188
+ Grayhawk
189
+ Green
190
+ Green Ridge
191
+ Grim
192
+ Grover
193
+ Gulseth
194
+ Haas
195
+ Hagan
196
+ Hallows
197
+ Hanover
198
+ Hanson
199
+ Hansons
200
+ Harbort
201
+ Harper
202
+ Hauk
203
+ Havey
204
+ Hayes
205
+ Hazelcrest
206
+ Heath
207
+ Heffernan
208
+ Helena
209
+ Hermina
210
+ High Crossing
211
+ Hintze
212
+ Hoard
213
+ Hoepker
214
+ Hoffman
215
+ Hollow Ridge
216
+ Holmberg
217
+ Holy Cross
218
+ Homewood
219
+ Hooker
220
+ Hovde
221
+ Hudson
222
+ Huxley
223
+ Ilene
224
+ Independence
225
+ International
226
+ Iowa
227
+ Jackson
228
+ Jana
229
+ Jay
230
+ Jenifer
231
+ Jenna
232
+ John Wall
233
+ Johnson
234
+ Judy
235
+ Karstens
236
+ Katie
237
+ Kedzie
238
+ Kennedy
239
+ Kensington
240
+ Kenwood
241
+ Killdeer
242
+ Kim
243
+ Kings
244
+ Kingsford
245
+ Kinsman
246
+ Kipling
247
+ Knutson
248
+ Kropf
249
+ La Follette
250
+ Lake View
251
+ Lakeland
252
+ Lakewood
253
+ Lakewood Gardens
254
+ Larry
255
+ Laurel
256
+ Lawn
257
+ Lerdahl
258
+ Leroy
259
+ Lien
260
+ Lighthouse Bay
261
+ Lillian
262
+ Lindbergh
263
+ Linden
264
+ Little Fleur
265
+ Loeprich
266
+ Loftsgordon
267
+ Logan
268
+ Londonderry
269
+ Longview
270
+ Loomis
271
+ Lotheville
272
+ Ludington
273
+ Lukken
274
+ Lunder
275
+ Luster
276
+ Lyons
277
+ Macpherson
278
+ Magdeline
279
+ Main
280
+ Mallard
281
+ Mallory
282
+ Mandrake
283
+ Manitowish
284
+ Manley
285
+ Manufacturers
286
+ Maple
287
+ Maple Wood
288
+ Marcy
289
+ Mariners Cove
290
+ Marquette
291
+ Maryland
292
+ Mayer
293
+ Mayfield
294
+ Maywood
295
+ Mcbride
296
+ Mccormick
297
+ Mcguire
298
+ Meadow Ridge
299
+ Meadow Vale
300
+ Meadow Valley
301
+ Melby
302
+ Melody
303
+ Melrose
304
+ Melvin
305
+ Memorial
306
+ Mendota
307
+ Menomonie
308
+ Merchant
309
+ Merrick
310
+ Merry
311
+ Messerschmidt
312
+ Mesta
313
+ Michigan
314
+ Mifflin
315
+ Miller
316
+ Milwaukee
317
+ Mitchell
318
+ Mockingbird
319
+ Moland
320
+ Monica
321
+ Montana
322
+ Monterey
323
+ Monument
324
+ Moose
325
+ Morning
326
+ Morningstar
327
+ Morrow
328
+ Mosinee
329
+ Moulton
330
+ Muir
331
+ Myrtle
332
+ Namekagon
333
+ Nancy
334
+ Nelson
335
+ Nevada
336
+ New Castle
337
+ Nobel
338
+ North
339
+ Northfield
340
+ Northland
341
+ Northport
342
+ Northridge
343
+ Northview
344
+ Northwestern
345
+ Norway Maple
346
+ Nova
347
+ Novick
348
+ Oak
349
+ Oak Valley
350
+ Oakridge
351
+ Ohio
352
+ Old Gate
353
+ Old Shore
354
+ Oneill
355
+ Onsgard
356
+ Orin
357
+ Oriole
358
+ Oxford
359
+ Packers
360
+ Paget
361
+ Pankratz
362
+ Park Meadow
363
+ Parkside
364
+ Pawling
365
+ Pearson
366
+ Pennsylvania
367
+ Pepper Wood
368
+ Petterle
369
+ Pierstorff
370
+ Pine View
371
+ Pleasure
372
+ Pond
373
+ Portage
374
+ Porter
375
+ Prairie Rose
376
+ Prairieview
377
+ Prentice
378
+ Quincy
379
+ Ramsey
380
+ Randy
381
+ Raven
382
+ Red Cloud
383
+ Redwing
384
+ Reindahl
385
+ Reinke
386
+ Ridge Oak
387
+ Ridgeview
388
+ Ridgeway
389
+ Rieder
390
+ Rigney
391
+ Riverside
392
+ Rockefeller
393
+ Ronald Regan
394
+ Roth
395
+ Rowland
396
+ Roxbury
397
+ Rusk
398
+ Ruskin
399
+ Russell
400
+ Rutledge
401
+ Ryan
402
+ Sachs
403
+ Sachtjen
404
+ Sage
405
+ Saint Paul
406
+ Sauthoff
407
+ Schiller
408
+ Schlimgen
409
+ Schmedeman
410
+ School
411
+ Schurz
412
+ Scofield
413
+ Scott
414
+ Scoville
415
+ Service
416
+ Shasta
417
+ Shelley
418
+ Sheridan
419
+ Sherman
420
+ Shopko
421
+ Shoshone
422
+ Sloan
423
+ Sommers
424
+ South
425
+ Southridge
426
+ Spaight
427
+ Spenser
428
+ Spohn
429
+ Springs
430
+ Springview
431
+ Stang
432
+ Starling
433
+ Steensland
434
+ Stephen
435
+ Stone Corner
436
+ Stoughton
437
+ Straubel
438
+ Stuart
439
+ Sugar
440
+ Sullivan
441
+ Summer Ridge
442
+ Summerview
443
+ Summit
444
+ Sunbrook
445
+ Sundown
446
+ Sunfield
447
+ Sunnyside
448
+ Superior
449
+ Surrey
450
+ Susan
451
+ Sutherland
452
+ Sutteridge
453
+ Swallow
454
+ Sycamore
455
+ Talisman
456
+ Talmadge
457
+ Tennessee
458
+ Tennyson
459
+ Texas
460
+ Thackeray
461
+ Thierer
462
+ Thompson
463
+ Toban
464
+ Tomscot
465
+ Tony
466
+ Towne
467
+ Trailsway
468
+ Transport
469
+ Troy
470
+ Truax
471
+ Twin Pines
472
+ Union
473
+ Upham
474
+ Utah
475
+ Vahlen
476
+ Valley Edge
477
+ Veith
478
+ Vera
479
+ Vermont
480
+ Vernon
481
+ Victoria
482
+ Vidon
483
+ Village
484
+ Village Green
485
+ Walton
486
+ Warbler
487
+ Warner
488
+ Warrior
489
+ Washington
490
+ Waubesa
491
+ Waxwing
492
+ Wayridge
493
+ Waywood
494
+ Weeping Birch
495
+ Welch
496
+ West
497
+ Westend
498
+ Westerfield
499
+ Westport
500
+ Westridge
@@ -0,0 +1,9 @@
1
+ biz
2
+ com
3
+ info
4
+ name
5
+ net
6
+ org
7
+ gov
8
+ edu
9
+ mil
@@ -0,0 +1,11 @@
1
+ class Array
2
+ def random
3
+ self[Kernel.rand(size)]
4
+ end
5
+
6
+ def random_subset(len=2)
7
+ rs = []
8
+ len.times { rs << random }
9
+ rs
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ class Hash
2
+ # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second.
3
+ def reverse_merge(other_hash)
4
+ other_hash.merge(self)
5
+ end
6
+
7
+ # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second.
8
+ # Modifies the receiver in place.
9
+ def reverse_merge!(other_hash)
10
+ replace(reverse_merge(other_hash))
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ class Range
2
+ def random
3
+ return nil unless self.max
4
+ Integer(min) && Integer(max)
5
+ Kernel.rand(self.max - self.min + 1) + self.min
6
+ rescue ArgumentError
7
+ self.to_a.random
8
+ end
9
+ end
@@ -0,0 +1,48 @@
1
+ class String
2
+ def to_numbers(replace='#')
3
+ self.gsub(/#{replace}/){ Kernel.rand(10) }
4
+ end
5
+
6
+ if !defined?(RAILS_ROOT)
7
+ def camelize(first_letter = :upper)
8
+ case first_letter
9
+ when :upper
10
+ to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
11
+ when :lower
12
+ first.downcase + camelize(self)[1..-1]
13
+ end
14
+ end
15
+
16
+ def underscore
17
+ to_s.gsub(/::/, '/').
18
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
19
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
20
+ tr("-", "_").
21
+ downcase
22
+ end
23
+
24
+ if Module.method(:const_get).arity == 1
25
+ def constantize
26
+ names = self.split('::')
27
+ names.shift if names.empty? || names.first.empty?
28
+
29
+ constant = Object
30
+ names.each do |name|
31
+ constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
32
+ end
33
+ constant
34
+ end
35
+ else
36
+ def constantize
37
+ names = self.split('::')
38
+ names.shift if names.empty? || names.first.empty?
39
+
40
+ constant = Object
41
+ names.each do |name|
42
+ constant = constant.const_get(name, false) || constant.const_missing(name)
43
+ end
44
+ constant
45
+ end
46
+ end
47
+ end
48
+ end