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
data/README.markdown ADDED
@@ -0,0 +1,81 @@
1
+ Forgery
2
+ =======
3
+
4
+ The Problem:
5
+ Making meaningful development data for your application.
6
+
7
+ The Solution:
8
+ A fake data generator that does more than just lorem ipsum and random text
9
+ (well, it does those too, but also does much more).
10
+
11
+ Forgery generates fake data from dictionaries, formats, and recipes. The
12
+ plugin includes a generator providing directories to make your own forgeries.
13
+
14
+
15
+ Generator
16
+ =========
17
+
18
+ <pre><code>
19
+ ./script/generate forgery
20
+ </code></pre>
21
+
22
+ In a rails project this generator creates:
23
+
24
+ * RAILS_ROOT/lib/forgery
25
+ * RAILS_ROOT/lib/forgery/dictionaries
26
+ * RAILS_ROOT/lib/forgery/extensions
27
+ * RAILS_ROOT/lib/forgery/forgeries
28
+ * RAILS_ROOT/lib/forgery/formats
29
+
30
+ You can then use these directories to write your own dictionaries, class
31
+ extensions, forgeries, and formats.
32
+
33
+ Forgery will look first here for dictionaries and formats, so you can override
34
+ the ones used in the plugin.
35
+
36
+ See the forgeries in the plugin for examples of how to write your own.
37
+
38
+ See which dictionaries each forgery uses to override them with your own.
39
+
40
+
41
+ Examples
42
+ ========
43
+
44
+ Here I'll supply a few examples of how it works, in general. See each forgery
45
+ for individual examples.
46
+
47
+ <pre><code>
48
+ BasicForgery.password # => "wYMYvq"
49
+ BasicForgery.password :allow_special => true # => ";Qo^N[T"
50
+ BasicForgery.hex_color # => "#f4d841"
51
+
52
+ MonetaryForgery.money # => "8.21"
53
+ MonetaryForgery.formatted_money # => "$3.25"
54
+ MonetaryForgery.money :min => 100, :max => 1000 # => "848.97"
55
+ </code></pre>
56
+
57
+ TODO
58
+ ====
59
+
60
+ * Delayed reading of dictionaries, forms, etc (speed and memory concerns)
61
+ * Add secondary syntax similar to Factory Girl (or better?)
62
+
63
+ Thanks
64
+ ======
65
+
66
+ Thanks to the authors and contributors:
67
+
68
+ * Nathan Sutton (nate aka fowlduck)
69
+ * Brandon Arbini (brandonarbini)
70
+ * Josh Nichols (technicalpickles)
71
+ * Jeremy Stephens (viking aka crookshanks)
72
+
73
+ Notes
74
+ =====
75
+
76
+ This is a work in progress. If you find bugs or have forgeries to contribute,
77
+ we'll gladly take them and give credit.
78
+
79
+ Enjoy.
80
+
81
+ Nate Sutton (nate@sevenwire.com)
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ patch: 0
3
+ major: 0
4
+ minor: 1
@@ -0,0 +1,6 @@
1
+
2
+ ./script/generate forgery
3
+
4
+ Creates the Forgery directories in RAILS_ROOT/lib. The contents of these
5
+ directories can be used to extend Forgery, adding new forgeries and overriding
6
+ dictionaries and formats.
@@ -0,0 +1,12 @@
1
+ class ForgeryGenerator < Rails::Generator::Base
2
+ def manifest
3
+ record do |m|
4
+ m.directory 'lib'
5
+ m.directory 'lib/forgery'
6
+ m.directory 'lib/forgery/dictionaries'
7
+ m.directory 'lib/forgery/extensions'
8
+ m.directory 'lib/forgery/forgeries'
9
+ m.directory 'lib/forgery/formats'
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,478 @@
1
+ Adelanto
2
+ Agoura Hills
3
+ Alameda
4
+ Albany
5
+ Alhambra
6
+ Aliso Viejo
7
+ Alturas
8
+ Amador City
9
+ American Canyon
10
+ Anaheim
11
+ Anderson
12
+ Angels Camp
13
+ Antioch
14
+ Apple Valley
15
+ Arcadia
16
+ Arcata
17
+ Arroyo Grande
18
+ Artesia
19
+ Arvin
20
+ Atascadero
21
+ Atherton
22
+ Atwater
23
+ Auburn
24
+ Avalon
25
+ Avenal
26
+ Azusa
27
+ Bakersfield
28
+ Baldwin Park
29
+ Banning
30
+ Barstow
31
+ Beaumont
32
+ Bell
33
+ Bell Gardens
34
+ Bellflower
35
+ Belmont
36
+ Belvedere
37
+ Benicia
38
+ Berkeley
39
+ Beverly Hills
40
+ Big Bear Lake
41
+ Biggs
42
+ Bishop
43
+ Blue Lake
44
+ Blythe
45
+ Bradbury
46
+ Brawley
47
+ Brea
48
+ Brentwood
49
+ Brisbane
50
+ Buellton
51
+ Buena Park
52
+ Burbank
53
+ Burlingame
54
+ Calabasas
55
+ Calexico
56
+ California City
57
+ Calimesa
58
+ Calipatria
59
+ Calistoga
60
+ Camarillo
61
+ Canyon Lake
62
+ Capitola
63
+ Carlsbad
64
+ Carmel-by-the-Sea
65
+ Carpinteria
66
+ Carson
67
+ Cathedral City
68
+ Ceres
69
+ Cerritos
70
+ Chico
71
+ Chino
72
+ Chino Hills
73
+ Chowchilla
74
+ Chula Vista
75
+ Citrus Heights
76
+ Claremont
77
+ Clayton
78
+ Clearlake
79
+ Cloverdale
80
+ Clovis
81
+ Coachella
82
+ Coalinga
83
+ Colfax
84
+ Colma
85
+ Colton
86
+ Colusa
87
+ City of Commerce
88
+ Compton
89
+ Concord
90
+ Corcoran
91
+ Corning
92
+ Corona
93
+ Coronado
94
+ Corte Madera
95
+ Costa Mesa
96
+ Cotati
97
+ Covina
98
+ Crescent City
99
+ Cudahy
100
+ Culver City
101
+ Cupertino
102
+ Cypress
103
+ Daly City
104
+ Dana Point
105
+ Danville
106
+ Davis
107
+ Del Mar
108
+ Del Rey Oaks
109
+ Delano
110
+ Desert Hot Springs
111
+ Diamond Bar
112
+ Dinuba
113
+ Dixon
114
+ Dorris
115
+ Dos Palos
116
+ Downey
117
+ Duarte
118
+ Dublin
119
+ Dunsmuir
120
+ East Palo Alto
121
+ El Cajon
122
+ El Centro
123
+ El Cerrito
124
+ El Monte
125
+ El Segundo
126
+ Elk Grove
127
+ Emeryville
128
+ Encinitas
129
+ Escalon
130
+ Escondido
131
+ Etna
132
+ Eureka
133
+ Exeter
134
+ Fairfax
135
+ Fairfield
136
+ Farmersville
137
+ Ferndale
138
+ Fillmore
139
+ Firebaugh
140
+ Folsom
141
+ Fontana
142
+ Fort Bragg
143
+ Fort Jones
144
+ Fortuna
145
+ Foster City
146
+ Fountain Valley
147
+ Fowler
148
+ Fremont
149
+ Fresno
150
+ Fullerton
151
+ Galt
152
+ Garden Grove
153
+ Gardena
154
+ Gilroy
155
+ Glendale
156
+ Glendora
157
+ Goleta
158
+ Gonzales
159
+ Grand Terrace
160
+ Grass Valley
161
+ Greenfield
162
+ Gridley
163
+ Grover Beach
164
+ Guadalupe
165
+ Gustine
166
+ Half Moon Bay
167
+ Hanford
168
+ Hawaiian Gardens
169
+ Hawthorne
170
+ Hayward
171
+ Healdsburg
172
+ Hemet
173
+ Hercules
174
+ Hermosa Beach
175
+ Hesperia
176
+ Hidden Hills
177
+ Highland
178
+ Hillsborough
179
+ Hollister
180
+ Holtville
181
+ Hughson
182
+ Huntington Beach
183
+ Huntington Park
184
+ Huron
185
+ Imperial
186
+ Imperial Beach
187
+ Indian Wells
188
+ Indio
189
+ City of Industry
190
+ Inglewood
191
+ Ione
192
+ Irvine
193
+ Irwindale
194
+ Isleton
195
+ Jackson
196
+ Kerman
197
+ King City
198
+ Kingsburg
199
+ La Cañada Flintridge
200
+ La Habra
201
+ La Habra Heights
202
+ La Mesa
203
+ La Mirada
204
+ La Palma
205
+ La Puente
206
+ La Quinta
207
+ La Verne
208
+ Lafayette
209
+ Laguna Beach
210
+ Laguna Hills
211
+ Laguna Niguel
212
+ Laguna Woods
213
+ Lake Elsinore
214
+ Lake Forest
215
+ Lakeport
216
+ Lakewood
217
+ Lancaster
218
+ Larkspur
219
+ Lathrop
220
+ Lawndale
221
+ Lemon Grove
222
+ Lemoore
223
+ Lincoln
224
+ Lindsay
225
+ Live Oak
226
+ Livermore
227
+ Livingston
228
+ Lodi
229
+ Loma Linda
230
+ Lomita
231
+ Lompoc
232
+ Long Beach
233
+ Loomis
234
+ Los Alamitos
235
+ Los Altos
236
+ Los Altos Hills
237
+ Los Angeles
238
+ Los Banos
239
+ Los Gatos
240
+ Loyalton
241
+ Lynwood
242
+ Madera
243
+ Malibu
244
+ Mammoth Lakes
245
+ Manhattan Beach
246
+ Manteca
247
+ Maricopa
248
+ Marina
249
+ Martinez
250
+ Marysville
251
+ Maywood
252
+ McFarland
253
+ Mendota
254
+ Menlo Park
255
+ Menifee
256
+ Merced
257
+ Mill Valley
258
+ Millbrae
259
+ Milpitas
260
+ Mission Viejo
261
+ Modesto
262
+ Monrovia
263
+ Montague
264
+ Montclair
265
+ Monte Sereno
266
+ Montebello
267
+ Monterey
268
+ Monterey Park
269
+ Moorpark
270
+ Moraga
271
+ Moreno Valley
272
+ Morgan Hill
273
+ Morro Bay
274
+ Mount Shasta
275
+ Mountain View
276
+ Murrieta
277
+ Napa
278
+ National City
279
+ Needles
280
+ Nevada City
281
+ Newark
282
+ Newman
283
+ Newport Beach
284
+ Norco
285
+ Norwalk
286
+ Novato
287
+ Oakdale
288
+ Oakland
289
+ Oakley
290
+ Oceanside
291
+ Ojai
292
+ Ontario
293
+ Orange
294
+ Orange Cove
295
+ Orinda
296
+ Orland
297
+ Oroville
298
+ Oxnard
299
+ Pacific Grove
300
+ Pacifica
301
+ Palm Desert
302
+ Palm Springs
303
+ Palmdale
304
+ Palo Alto
305
+ Palos Verdes Estates
306
+ Paradise
307
+ Paramount
308
+ Parlier
309
+ Pasadena
310
+ Paso Robles
311
+ Patterson
312
+ Perris
313
+ Petaluma
314
+ Pico Rivera
315
+ Piedmont
316
+ Pinole
317
+ Pismo Beach
318
+ Pittsburg
319
+ Placentia
320
+ Placerville
321
+ Pleasant Hill
322
+ Pleasanton
323
+ Plymouth
324
+ Point Arena
325
+ Pomona
326
+ Port Hueneme
327
+ Porterville
328
+ Portola
329
+ Portola Valley
330
+ Poway
331
+ Rancho Cordova
332
+ Rancho Cucamonga
333
+ Rancho Mirage
334
+ Rancho Palos Verdes
335
+ Rancho Santa Margarita
336
+ Red Bluff
337
+ Redding
338
+ Redlands
339
+ Redondo Beach
340
+ Redwood City
341
+ Reedley
342
+ Rialto
343
+ Richmond
344
+ Ridgecrest
345
+ Rio Dell
346
+ Rio Vista
347
+ Ripon
348
+ Riverbank
349
+ Riverside
350
+ Rocklin
351
+ Rohnert Park
352
+ Rolling Hills
353
+ Rolling Hills Estates
354
+ Rosemead
355
+ Roseville
356
+ Ross
357
+ Sacramento
358
+ Salinas
359
+ San Anselmo
360
+ San Bernardino
361
+ San Bruno
362
+ San Carlos
363
+ San Clemente
364
+ San Diego
365
+ San Dimas
366
+ San Fernando
367
+ San Francisco
368
+ San Gabriel
369
+ San Jacinto
370
+ San Joaquin
371
+ San Jose
372
+ San Juan Bautista
373
+ San Juan Capistrano
374
+ San Leandro
375
+ San Luis Obispo
376
+ San Marcos
377
+ San Marino
378
+ San Mateo
379
+ San Pablo
380
+ San Rafael
381
+ San Ramon
382
+ Sand City
383
+ Sanger
384
+ Santa Ana
385
+ Santa Barbara
386
+ Santa Clara
387
+ Santa Clarita
388
+ Santa Cruz
389
+ Santa Fe Springs
390
+ Santa Maria
391
+ Santa Monica
392
+ Santa Paula
393
+ Santa Rosa
394
+ Santee
395
+ Saratoga
396
+ Sausalito
397
+ Scotts Valley
398
+ Seal Beach
399
+ Seaside
400
+ Sebastopol
401
+ Selma
402
+ Shafter
403
+ Shasta Lake
404
+ Sierra Madre
405
+ Signal Hill
406
+ Simi Valley
407
+ Solana Beach
408
+ Soledad
409
+ Solvang
410
+ Sonoma
411
+ Sonora
412
+ South El Monte
413
+ South Gate
414
+ South Lake Tahoe
415
+ South Pasadena
416
+ South San Francisco
417
+ St. Helena
418
+ Stanton
419
+ Stockton
420
+ Studio City
421
+ Suisun City
422
+ Sunnyvale
423
+ Susanville
424
+ Sutter Creek
425
+ Taft
426
+ Tehachapi
427
+ Tehama
428
+ Temecula
429
+ Temple City
430
+ Thousand Oaks
431
+ Tiburon
432
+ Torrance
433
+ Tracy
434
+ Trinidad
435
+ Truckee
436
+ Tulare
437
+ Tulelake
438
+ Turlock
439
+ Tustin
440
+ Twentynine Palms
441
+ Ukiah
442
+ Union City
443
+ Upland
444
+ Vacaville
445
+ Vallejo
446
+ Ventura
447
+ Vernon
448
+ Victorville
449
+ Villa Park
450
+ Visalia
451
+ Vista
452
+ Walnut
453
+ Walnut Creek
454
+ Wasco
455
+ Waterford
456
+ Watsonville
457
+ Weed
458
+ West Covina
459
+ West Sacramento
460
+ Westlake Village
461
+ Westminster
462
+ Westmorland
463
+ Wheatland
464
+ Whittier
465
+ Williams
466
+ Willits
467
+ Willows
468
+ Windsor
469
+ Winters
470
+ Woodlake
471
+ Woodland
472
+ Woodside
473
+ Yorba Linda
474
+ Yountville
475
+ Yreka
476
+ Yuba City
477
+ Yucaipa
478
+ Yucca Valley
@@ -0,0 +1,19 @@
1
+ Red
2
+ Blue
3
+ Green
4
+ Yellow
5
+ Orange
6
+ Purple
7
+ Violet
8
+ Indigo
9
+ Teal
10
+ Pink
11
+ Fuscia
12
+ Goldenrod
13
+ Mauv
14
+ Aquamarine
15
+ Turquoise
16
+ Crimson
17
+ Maroon
18
+ Puce
19
+ Khaki