Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged threading support to master and fixed ruby 2.4 integer data ty…
…pe issues bumped up version to 0.8.1
- Loading branch information
1 parent
0eaeb3c
commit ef2b2d2
Showing
25 changed files
with
251 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
system 'rake empty_dest' # clean destination database on every call | ||
|
||
require 'data-anonymization' | ||
|
||
DataAnon::Utils::Logging.logger.level = Logger::INFO | ||
|
||
database 'Chinook' do | ||
strategy DataAnon::Strategy::Whitelist | ||
source_db :adapter => 'sqlite3', :database => 'sample-data/chinook.sqlite' | ||
destination_db :adapter => 'sqlite3', :database => 'sample-data/chinook-empty.sqlite' | ||
|
||
default_field_strategies :string => FieldStrategy::StringTemplate.new('Sunit #{row_number} Parekh') | ||
|
||
table 'Genre' do | ||
primary_key 'GenreId' | ||
whitelist 'GenreId' | ||
anonymize 'Name' do |field| | ||
field.value + ' test' | ||
end | ||
end | ||
|
||
table 'MediaType' do | ||
primary_key 'MediaTypeId' | ||
anonymize('MediaTypeId') { |field| field.value } # same as whitelist | ||
anonymize('Name').using FieldStrategy::StringTemplate.new('Media Type #{row_number}') | ||
|
||
end | ||
|
||
table 'Customer' do | ||
primary_key 'CustomerId' | ||
thread_num 5 # thread_num | ||
|
||
whitelist 'CustomerId', 'SupportRepId', 'Company' | ||
anonymize('Phone').using FieldStrategy::RandomPhoneNumber.new | ||
anonymize('FirstName').using FieldStrategy::RandomFirstName.new | ||
anonymize('LastName').using FieldStrategy::RandomLastName.new | ||
anonymize('Address').using FieldStrategy::RandomAddress.region_US | ||
anonymize('City').using FieldStrategy::RandomCity.region_US | ||
anonymize('State').using FieldStrategy::RandomProvince.region_US | ||
anonymize('PostalCode').using FieldStrategy::RandomZipcode.region_US | ||
anonymize('Country') {|field| 'USA'} | ||
anonymize('Fax').using FieldStrategy::RandomPhoneNumber.new | ||
anonymize('Email').using FieldStrategy::StringTemplate.new('test+#{row_number}@gmail.com') | ||
end | ||
|
||
table 'Employee' do | ||
thread_num 5 # thread_num | ||
|
||
whitelist 'EmployeeId', 'ReportsTo', 'Title' | ||
anonymize('BirthDate').using FieldStrategy::DateTimeDelta.new(1, 1) | ||
anonymize('FirstName').using FieldStrategy::RandomFirstName.new | ||
anonymize('LastName').using FieldStrategy::RandomLastName.new | ||
anonymize('HireDate').using FieldStrategy::DateTimeDelta.new(2, 0) | ||
anonymize('Address').using FieldStrategy::RandomAddress.region_US | ||
anonymize('City').using FieldStrategy::RandomCity.region_US | ||
anonymize('State').using FieldStrategy::RandomProvince.region_US | ||
anonymize('PostalCode').using FieldStrategy::RandomZipcode.region_US | ||
anonymize('Country') {|field| 'USA'} | ||
anonymize('Phone').using FieldStrategy::RandomPhoneNumber.new | ||
anonymize('Fax').using FieldStrategy::RandomPhoneNumber.new | ||
anonymize('Email').using FieldStrategy::StringTemplate.new('test+#{row_number}@gmail.com') | ||
end | ||
|
||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
require "version" | ||
require 'version' | ||
|
||
require "utils/logging" | ||
require "utils/random_int" | ||
require "utils/random_float" | ||
require "utils/random_string" | ||
require "utils/random_string_chars_only" | ||
require "utils/geojson_parser" | ||
require "utils/progress_bar" | ||
require "utils/parallel_progress_bar" | ||
require "utils/resource" | ||
require "utils/template_helper" | ||
require "parallel/table" | ||
require "core/database" | ||
require "core/fields_missing_strategy" | ||
require "thor/helpers/rdbms_dsl_generator" | ||
require "core/field" | ||
require "core/table_errors" | ||
require "strategy/strategies" | ||
require "utils/database" | ||
require "core/dsl" | ||
require 'utils/logging' | ||
require 'utils/random_int' | ||
require 'utils/random_float' | ||
require 'utils/random_string' | ||
require 'utils/random_string_chars_only' | ||
require 'utils/geojson_parser' | ||
require 'utils/progress_bar' | ||
require 'utils/parallel_progress_bar' | ||
require 'utils/resource' | ||
require 'utils/template_helper' | ||
require 'parallel/table' | ||
require 'core/database' | ||
require 'core/fields_missing_strategy' | ||
require 'thor/helpers/rdbms_dsl_generator' | ||
require 'core/field' | ||
require 'core/table_errors' | ||
require 'strategy/strategies' | ||
require 'utils/database' | ||
require 'core/dsl' | ||
|
||
begin | ||
require 'mongo' | ||
require "thor/helpers/mongodb_dsl_generator" | ||
require 'thor/helpers/mongodb_dsl_generator' | ||
rescue LoadError | ||
"Ignoring the mongodb specific libraries if monog driver is not specified in gem" | ||
'Ignoring the mongodb specific libraries if monog driver is not specified in gem' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module DataAnonymization | ||
VERSION = '0.8.0' | ||
VERSION = '0.8.1' | ||
end |
Oops, something went wrong.