data-anonymization 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/.documentup.json +8 -0
  2. data/.gitignore +20 -0
  3. data/.rspec +2 -0
  4. data/.rvmrc +1 -0
  5. data/.travis.yml +6 -0
  6. data/Gemfile +12 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +256 -0
  9. data/Rakefile +9 -0
  10. data/blacklist_dsl.rb +19 -0
  11. data/blacklist_nosql_dsl.rb +36 -0
  12. data/data-anonymization.gemspec +22 -0
  13. data/lib/core/database.rb +36 -0
  14. data/lib/core/dsl.rb +16 -0
  15. data/lib/core/field.rb +18 -0
  16. data/lib/data-anonymization.rb +12 -0
  17. data/lib/strategy/base.rb +67 -0
  18. data/lib/strategy/blacklist.rb +18 -0
  19. data/lib/strategy/field/anonymize_time.rb +57 -0
  20. data/lib/strategy/field/anonymous.rb +21 -0
  21. data/lib/strategy/field/date_time_delta.rb +24 -0
  22. data/lib/strategy/field/default_anon.rb +28 -0
  23. data/lib/strategy/field/distinct_column_values.rb +25 -0
  24. data/lib/strategy/field/fields.rb +23 -0
  25. data/lib/strategy/field/gmail_template.rb +17 -0
  26. data/lib/strategy/field/lorem_ipsum.rb +29 -0
  27. data/lib/strategy/field/random_boolean.rb +19 -0
  28. data/lib/strategy/field/random_email.rb +31 -0
  29. data/lib/strategy/field/random_first_name.rb +18 -0
  30. data/lib/strategy/field/random_float_delta.rb +24 -0
  31. data/lib/strategy/field/random_full_name.rb +28 -0
  32. data/lib/strategy/field/random_int.rb +23 -0
  33. data/lib/strategy/field/random_integer_delta.rb +21 -0
  34. data/lib/strategy/field/random_last_name.rb +19 -0
  35. data/lib/strategy/field/random_mailinator_email.rb +20 -0
  36. data/lib/strategy/field/random_phone_number.rb +24 -0
  37. data/lib/strategy/field/random_selection.rb +23 -0
  38. data/lib/strategy/field/random_string.rb +22 -0
  39. data/lib/strategy/field/random_user_name.rb +23 -0
  40. data/lib/strategy/field/string_template.rb +22 -0
  41. data/lib/strategy/field/user_name_template.rb +22 -0
  42. data/lib/strategy/field/whitelist.rb +17 -0
  43. data/lib/strategy/strategies.rb +4 -0
  44. data/lib/strategy/whitelist.rb +21 -0
  45. data/lib/tasks/rake_tasks.rb +19 -0
  46. data/lib/utils/database.rb +53 -0
  47. data/lib/utils/logging.rb +29 -0
  48. data/lib/utils/random_int.rb +15 -0
  49. data/lib/utils/random_string.rb +14 -0
  50. data/lib/utils/resource.rb +13 -0
  51. data/lib/version.rb +3 -0
  52. data/resources/first_names.txt +500 -0
  53. data/resources/last_names.txt +500 -0
  54. data/spec/acceptance/rdbms_blacklist_spec.rb +30 -0
  55. data/spec/acceptance/rdbms_whitelist_spec.rb +50 -0
  56. data/spec/spec_helper.rb +26 -0
  57. data/spec/strategy/field/anonymize_time_spec.rb +23 -0
  58. data/spec/strategy/field/date_time_delta_spec.rb +43 -0
  59. data/spec/strategy/field/distinct_column_values_spec.rb +22 -0
  60. data/spec/strategy/field/gmail_template_spec.rb +14 -0
  61. data/spec/strategy/field/lorem_ipsum_spec.rb +27 -0
  62. data/spec/strategy/field/random_boolean_spec.rb +16 -0
  63. data/spec/strategy/field/random_email_spec.rb +18 -0
  64. data/spec/strategy/field/random_first_name_spec.rb +14 -0
  65. data/spec/strategy/field/random_float_delta_spec.rb +21 -0
  66. data/spec/strategy/field/random_full_name_spec.rb +23 -0
  67. data/spec/strategy/field/random_int_spec.rb +28 -0
  68. data/spec/strategy/field/random_integer_delta_spec.rb +23 -0
  69. data/spec/strategy/field/random_last_name_spec.rb +14 -0
  70. data/spec/strategy/field/random_mailinator_email_spec.rb +21 -0
  71. data/spec/strategy/field/random_phone_number_spec.rb +35 -0
  72. data/spec/strategy/field/random_selection_spec.rb +36 -0
  73. data/spec/strategy/field/random_string_spec.rb +23 -0
  74. data/spec/strategy/field/random_user_name_spec.rb +23 -0
  75. data/spec/strategy/field/string_template_spec.rb +15 -0
  76. data/spec/strategy/field/user_name_template_spec.rb +13 -0
  77. data/spec/strategy/field/whitelist_spec.rb +21 -0
  78. data/spec/support/customer_sample.rb +43 -0
  79. data/spec/utils/database_spec.rb +26 -0
  80. data/spec/utils/random_int_spec.rb +9 -0
  81. data/spec/utils/random_string_spec.rb +8 -0
  82. data/whitelist_dsl.rb +44 -0
  83. metadata +192 -0
@@ -0,0 +1,14 @@
1
+ module DataAnon
2
+ module Utils
3
+ class RandomString
4
+
5
+ def self.generate length = nil
6
+ length ||= Random.new.rand 5...15
7
+ chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'
8
+ random_string = ''
9
+ length.times { random_string << chars[rand(chars.size)] }
10
+ random_string
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ module DataAnon
2
+ module Utils
3
+
4
+ class Resource
5
+
6
+ def self.file file_name
7
+ project_home = File.join(File.dirname(__FILE__), '../../')
8
+ "#{project_home}resources/#{file_name}"
9
+ end
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module DataAnonymization
2
+ VERSION = "0.1.2"
3
+ end
@@ -0,0 +1,500 @@
1
+ Mozella
2
+ Corie
3
+ Pamela
4
+ Rivka
5
+ Zonia
6
+ Etta
7
+ Shenika
8
+ Shakira
9
+ Ana
10
+ Asa
11
+ Kimbery
12
+ Manual
13
+ Eleanore
14
+ Shalon
15
+ Catherin
16
+ Michaela
17
+ Danette
18
+ Ha
19
+ Daniele
20
+ Treena
21
+ Phil
22
+ Jaunita
23
+ Audrea
24
+ Milton
25
+ Waylon
26
+ Vinnie
27
+ Letitia
28
+ Clelia
29
+ Bennie
30
+ Kimiko
31
+ Oleta
32
+ Walter
33
+ Raquel
34
+ Lizbeth
35
+ Rosella
36
+ Corrine
37
+ Lorine
38
+ Ethyl
39
+ Rosalina
40
+ Freddie
41
+ Jamika
42
+ Hugo
43
+ Patsy
44
+ Karla
45
+ Chery
46
+ Beckie
47
+ Melonie
48
+ Nelia
49
+ Hien
50
+ Luke
51
+ Leola
52
+ Flora
53
+ Theodore
54
+ Genny
55
+ Wilfredo
56
+ Robin
57
+ Shera
58
+ Rudy
59
+ Kai
60
+ Lelia
61
+ Young
62
+ Steffanie
63
+ Shena
64
+ Foster
65
+ Bradford
66
+ Georgetta
67
+ Cherelle
68
+ Daphne
69
+ Terrence
70
+ Obdulia
71
+ Deloris
72
+ Garrett
73
+ Kristian
74
+ Ashlea
75
+ Maribel
76
+ Kyra
77
+ Jerrold
78
+ Tajuana
79
+ Ilda
80
+ Faustina
81
+ Tayna
82
+ Ludivina
83
+ Hyun
84
+ Edris
85
+ Loan
86
+ Christena
87
+ Reynaldo
88
+ Andreas
89
+ Danita
90
+ Lesli
91
+ Chantay
92
+ Season
93
+ Mellisa
94
+ Celinda
95
+ Angla
96
+ Sharlene
97
+ Maritza
98
+ Gwyn
99
+ Floy
100
+ Derrick
101
+ Letisha
102
+ Gino
103
+ Kassie
104
+ Alysa
105
+ Jacob
106
+ Shemika
107
+ Ivette
108
+ Celestina
109
+ Merissa
110
+ Kati
111
+ Carlotta
112
+ Shala
113
+ Dewitt
114
+ Leo
115
+ Alberta
116
+ Collen
117
+ Hue
118
+ Helga
119
+ Danna
120
+ Vanna
121
+ Joy
122
+ Sharonda
123
+ Reid
124
+ Aundrea
125
+ Gabrielle
126
+ Karyn
127
+ Rashida
128
+ Benita
129
+ Margherita
130
+ Yan
131
+ Ling
132
+ Melda
133
+ Gerda
134
+ Flor
135
+ Ferne
136
+ Dorinda
137
+ Ella
138
+ Cornelius
139
+ Malisa
140
+ Ned
141
+ Odelia
142
+ Era
143
+ Brittany
144
+ Babara
145
+ Shelby
146
+ Myesha
147
+ Sanjuana
148
+ Margarite
149
+ Roosevelt
150
+ Bette
151
+ Roger
152
+ Lawanda
153
+ Alan
154
+ Shiloh
155
+ Calvin
156
+ Bell
157
+ Merlin
158
+ Louis
159
+ Branda
160
+ Magen
161
+ Augustina
162
+ Caroyln
163
+ Milan
164
+ Ardella
165
+ Adrianna
166
+ Justine
167
+ Rosamond
168
+ Arianne
169
+ Cortez
170
+ Fredrick
171
+ Evelyne
172
+ Christina
173
+ Tania
174
+ Loretta
175
+ Franchesca
176
+ Jules
177
+ Fernanda
178
+ Kaitlin
179
+ Melva
180
+ Leeanna
181
+ Nathalie
182
+ Fermin
183
+ Evelia
184
+ Lucius
185
+ Kit
186
+ Barabara
187
+ Paz
188
+ Han
189
+ Shantay
190
+ Tyson
191
+ Debroah
192
+ Angle
193
+ Jodie
194
+ Bettyann
195
+ Ocie
196
+ Sidney
197
+ Delphia
198
+ Monet
199
+ Bess
200
+ George
201
+ Jamaal
202
+ Alix
203
+ Louise
204
+ Aurora
205
+ Tommye
206
+ Cornelia
207
+ Michele
208
+ Isa
209
+ Long
210
+ Cheree
211
+ Ofelia
212
+ Sonya
213
+ Reita
214
+ Mayme
215
+ Shila
216
+ Robyn
217
+ Zana
218
+ Rolf
219
+ Elise
220
+ Whitley
221
+ Leota
222
+ Elizebeth
223
+ Emilie
224
+ Joellen
225
+ Yasmin
226
+ Emogene
227
+ Rosalinda
228
+ Rosalind
229
+ Margarette
230
+ Omar
231
+ Earl
232
+ Irma
233
+ Tawanna
234
+ Ivy
235
+ Burton
236
+ Patience
237
+ Nelda
238
+ Emery
239
+ Maryrose
240
+ Carri
241
+ Dominique
242
+ Essie
243
+ Ria
244
+ Corinne
245
+ Zulma
246
+ Terresa
247
+ Everett
248
+ Petra
249
+ Phyllis
250
+ Dyan
251
+ Machelle
252
+ Willian
253
+ Cruz
254
+ Adah
255
+ Ashlyn
256
+ Verena
257
+ Briana
258
+ Sherill
259
+ Adina
260
+ Chi
261
+ Domenic
262
+ Kirby
263
+ Gracia
264
+ Rickie
265
+ Charity
266
+ Terina
267
+ Rutha
268
+ Jeramy
269
+ Tempie
270
+ Emerald
271
+ Candice
272
+ Marcelina
273
+ Luis
274
+ Laurinda
275
+ Kenia
276
+ Lyman
277
+ Merle
278
+ Tonja
279
+ Valrie
280
+ Julietta
281
+ Evelyn
282
+ Angelique
283
+ Shirlene
284
+ Amada
285
+ Bernice
286
+ Kimberlee
287
+ Tomasa
288
+ Min
289
+ Joane
290
+ Kathleen
291
+ Jessika
292
+ Mamie
293
+ Tonia
294
+ Anjanette
295
+ Hassan
296
+ Darby
297
+ Lyn
298
+ Lloyd
299
+ Helena
300
+ Tashina
301
+ Suzanne
302
+ Sherley
303
+ Katherina
304
+ Shaniqua
305
+ Dolly
306
+ Kara
307
+ Gwendolyn
308
+ Noah
309
+ Chastity
310
+ Marlyn
311
+ Veronique
312
+ Donny
313
+ Lahoma
314
+ Nathan
315
+ Kristen
316
+ Adelina
317
+ Kaleigh
318
+ Myrta
319
+ Carmina
320
+ Bryan
321
+ Shamika
322
+ Wilmer
323
+ Arletta
324
+ Bulah
325
+ Carl
326
+ Marian
327
+ Cyndi
328
+ Wen
329
+ Melony
330
+ Johana
331
+ Iraida
332
+ Marc
333
+ Leighann
334
+ Elenora
335
+ Golda
336
+ Donovan
337
+ Annika
338
+ Lavinia
339
+ Delena
340
+ Pattie
341
+ Carmelita
342
+ Katherin
343
+ Deidre
344
+ Andria
345
+ Silvana
346
+ Bianca
347
+ Dayna
348
+ Milo
349
+ Ricky
350
+ Caterina
351
+ Valery
352
+ Gisele
353
+ Maren
354
+ Tena
355
+ Lexie
356
+ Tabatha
357
+ Myrna
358
+ Kizzie
359
+ Particia
360
+ Gena
361
+ Ming
362
+ Allen
363
+ Lauran
364
+ Virgie
365
+ Myra
366
+ Jim
367
+ Arlena
368
+ Marvel
369
+ Roseanna
370
+ Otto
371
+ Pearlene
372
+ Katrice
373
+ Kecia
374
+ Monte
375
+ Matilde
376
+ Tamisha
377
+ Bethany
378
+ Elbert
379
+ Danae
380
+ Shane
381
+ Hank
382
+ Marcia
383
+ Neoma
384
+ Edwina
385
+ Anita
386
+ Sharilyn
387
+ Emely
388
+ Christa
389
+ Tressa
390
+ Idalia
391
+ Franklin
392
+ Iesha
393
+ Kyong
394
+ Janella
395
+ Lili
396
+ Belen
397
+ Arnetta
398
+ Christiana
399
+ Verda
400
+ Suzann
401
+ Carola
402
+ Katharina
403
+ Molly
404
+ Josefine
405
+ Danika
406
+ Shirely
407
+ Cinda
408
+ Marla
409
+ Jonah
410
+ Tom
411
+ Zenobia
412
+ Katheleen
413
+ Jacklyn
414
+ Beryl
415
+ Shan
416
+ Jeannie
417
+ Saturnina
418
+ Ellen
419
+ Jarod
420
+ Kelsi
421
+ Freida
422
+ Hal
423
+ Merri
424
+ Nia
425
+ Amee
426
+ Illa
427
+ Sherrill
428
+ Elene
429
+ Tomi
430
+ Amberly
431
+ Forrest
432
+ Corinna
433
+ Marleen
434
+ Clarissa
435
+ Dee
436
+ Lucy
437
+ Carlo
438
+ Erma
439
+ Curt
440
+ Lavada
441
+ Shyla
442
+ Maia
443
+ Margorie
444
+ Pricilla
445
+ Abby
446
+ Catalina
447
+ Mui
448
+ Ellamae
449
+ Everette
450
+ Jeremiah
451
+ Pamula
452
+ Malena
453
+ Golden
454
+ Elza
455
+ Joi
456
+ Frankie
457
+ Noemi
458
+ Josefina
459
+ Rubye
460
+ Shirly
461
+ Mika
462
+ Shira
463
+ Sharita
464
+ Lucile
465
+ Anthony
466
+ Thomasine
467
+ Angelia
468
+ Kizzy
469
+ Mona
470
+ Jaye
471
+ Wilda
472
+ Aaron
473
+ Ervin
474
+ Karleen
475
+ Danuta
476
+ Keneth
477
+ Fonda
478
+ Walton
479
+ Wanetta
480
+ Charlott
481
+ Elvina
482
+ Marin
483
+ Jessi
484
+ Alfred
485
+ Darin
486
+ Chloe
487
+ Ardelle
488
+ Madlyn
489
+ Terence
490
+ Concetta
491
+ Debbi
492
+ Teddy
493
+ Leopoldo
494
+ Charla
495
+ Kristin
496
+ Emmanuel
497
+ Porsche
498
+ Kiesha
499
+ Ruth
500
+ Kasey