data-anonymization 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac74c87995181865fff4bef5837e979b81bb1775
4
- data.tar.gz: 37ce308ffc41359b70ce2165d026e7995d171e2a
3
+ metadata.gz: 1af6e282a48af25be06ef949bd2ab2c0fe3fed17
4
+ data.tar.gz: deba9d0f133ca325b1595ae6518fc50f2f4b6ba2
5
5
  SHA512:
6
- metadata.gz: 4606d6e02fbb708ffba87f527b7c6c0211475c81bedf70a50fac634493efe01bb4277982d2569a713757678ed193ef3e53431fd2b4b87caaddc784b34b98d30a
7
- data.tar.gz: 8fe977d7bf9fa1e7d9787da7b886419b55e6b7033edb25a616cb2462319bd8a75a4b2fa2f63175ecc42a0668cdb0ae138c4583f0669af45c3239658617f9fdbe
6
+ metadata.gz: 6f1d8f831a0253487af95ca1a2c906ee7b3131ae397da53dd1e106e6e1a66ac0bac7a5d236f55f4e7a74d04b2c38433c8e0c606f983dd141a3570f6e94f6efdc
7
+ data.tar.gz: e7b818960b49dc1aa59c48319e45a506e5ff50f036f958f6d62bf6f529d730cdce06ffadb53d0033ab45e0e56f795675f6825c3d941acf449cae429f08787dc6
@@ -0,0 +1 @@
1
+ repo_token: iq3YwsHsWi20COgLsNkJMLsbXin813TLt
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --color
2
- #--profile
2
+ #--profile
3
+ #--format documentation
@@ -0,0 +1 @@
1
+ data-anon
@@ -0,0 +1 @@
1
+ ruby-2.0.0-p353
data/Gemfile CHANGED
@@ -10,5 +10,6 @@ group :development, :test do
10
10
  gem 'sqlite3'
11
11
  gem 'mongo'
12
12
  gem 'bson_ext'
13
+ gem 'coveralls', require: false
13
14
  end
14
15
 
data/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # Data::Anonymization
2
- Tool to create anonymized production data dump to use for PERF and other TEST environments.
2
+ Afraid of getting production data due to privacy issues. Data Anonymization tool ban help you to build anonymized production data dump to use for testing like performance and security, debugging production issues and development purpose.
3
3
 
4
4
  [<img src="https://secure.travis-ci.org/sunitparekh/data-anonymization.png?branch=master">](http://travis-ci.org/sunitparekh/data-anonymization)
5
5
  [<img src="https://gemnasium.com/sunitparekh/data-anonymization.png?travis">](https://gemnasium.com/sunitparekh/data-anonymization)
6
6
  [<img src="https://codeclimate.com/badge.png">](https://codeclimate.com/github/sunitparekh/data-anonymization)
7
+ [![Coverage Status](https://coveralls.io/repos/sunitparekh/data-anonymization/badge.png?branch=master)](https://coveralls.io/r/sunitparekh/data-anonymization?branch=master)
7
8
 
8
9
  ## Getting started
9
10
 
@@ -68,6 +69,10 @@ Postgresql database having **composite primary key**
68
69
 
69
70
  ## Changelog
70
71
 
72
+ #### 0.5.5 (Dec 4, 2013)
73
+ 1. Upgraded gems to latest versions
74
+
75
+
71
76
  #### 0.5.2 (Jan 29, 2013)
72
77
 
73
78
  1. Fixed [issue #17](https://github.com/sunitparekh/data-anonymization/issues/17)
@@ -4,18 +4,20 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
- gem.name = "data-anonymization"
7
+ gem.name = 'data-anonymization'
8
8
  gem.version = DataAnonymization::VERSION
9
- gem.authors = ["Sunit Parekh", "Anand Agrawal", "Satyam Agarwala"]
10
- gem.email = ["parekh.sunit@gmail.com","anand.agrawal84@gmail.com", "satyamag@gmail.com"]
9
+ gem.authors = ['Sunit Parekh', 'Anand Agrawal', 'Satyam Agarwala']
10
+ gem.email = ['parekh.sunit@gmail.com','anand.agrawal84@gmail.com', 'satyamag@gmail.com']
11
11
  gem.description = %q{Data anonymization tool for RDBMS databases}
12
12
  gem.summary = %q{Tool to create anonymized production data dump to use for PREF and other TEST environments.}
13
- gem.homepage = "http://sunitparekh.github.com/data-anonymization"
13
+ gem.homepage = 'http://sunitparekh.github.com/data-anonymization'
14
+ gem.license = 'MIT'
15
+
14
16
 
15
17
  gem.files = `git ls-files`.split($/).select { |f| !f.match(/^sample-data/) }
16
- gem.executables = "datanon"
18
+ gem.executables = 'datanon'
17
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
20
+ gem.require_paths = ['lib']
19
21
 
20
22
  gem.add_dependency('activerecord', '~> 3.2.13')
21
23
  gem.add_dependency('composite_primary_keys', '~> 5.0.12')
@@ -23,6 +25,6 @@ Gem::Specification.new do |gem|
23
25
  gem.add_dependency('rgeo', '~> 0.3.20')
24
26
  gem.add_dependency('rgeo-geojson', '~> 0.2.3')
25
27
  gem.add_dependency('powerbar', '~> 1.0.11')
26
- gem.add_dependency('parallel', '~> 0.6.3')
27
- gem.add_dependency('thor', '~> 0.17.0')
28
+ gem.add_dependency('parallel', '~> 0.9.1')
29
+ gem.add_dependency('thor', '~> 0.18.1')
28
30
  end
@@ -11,6 +11,7 @@ module DataAnon
11
11
  @tables = []
12
12
  @execution_strategy = DataAnon::Core::Sequential
13
13
  ENV['parallel_execution'] = 'false'
14
+ I18n.enforce_available_locales = false
14
15
  end
15
16
 
16
17
  def strategy strategy
@@ -1,3 +1,3 @@
1
1
  module DataAnonymization
2
- VERSION = "0.5.4"
2
+ VERSION = '0.5.5'
3
3
  end
@@ -33,7 +33,7 @@ describe "End 2 End MongoDB Blacklist Acceptance Test" do
33
33
  "updated_at" => Time.new(2012, 2, 11, 13, 1, 0)
34
34
  }
35
35
  ]
36
- users_coll = Mongo::Connection.from_uri("mongodb://localhost/dest",{:safe => true})['test']['users']
36
+ users_coll = Mongo::Connection.from_uri("mongodb://localhost/dest")['test']['users']
37
37
  users.each { |p| users_coll.save p }
38
38
  end
39
39
 
@@ -41,7 +41,7 @@ describe "End 2 End MongoDB Blacklist Acceptance Test" do
41
41
 
42
42
  database 'test' do
43
43
  strategy DataAnon::Strategy::MongoDB::Blacklist
44
- source_db :mongodb_uri => "mongodb://localhost/test", :database => 'test', :options => {:safe => true}
44
+ source_db :mongodb_uri => "mongodb://localhost/test", :database => 'test'
45
45
 
46
46
  collection 'users' do
47
47
  anonymize('date_of_birth').using FieldStrategy::TimeDelta.new(5,30)
@@ -59,7 +59,7 @@ describe "End 2 End MongoDB Whitelist Acceptance Test" do
59
59
  database 'test' do
60
60
  strategy DataAnon::Strategy::MongoDB::Whitelist
61
61
  source_db :mongodb_uri => "mongodb://localhost/test", :database => 'test'
62
- destination_db :mongodb_uri => "mongodb://localhost/dest", :database => 'dest', :options => {:safe => true}
62
+ destination_db :mongodb_uri => "mongodb://localhost/dest", :database => 'dest'
63
63
 
64
64
  collection 'plans' do
65
65
  whitelist '_id', 'name', 'term', 'created_at'
@@ -1,7 +1,10 @@
1
1
  require 'rspec'
2
2
  require "pry"
3
- require 'data-anonymization'
3
+ require 'coveralls'
4
+
5
+ Coveralls.wear!
4
6
 
7
+ require 'data-anonymization'
5
8
 
6
9
  ENV['show_progress'] = 'false'
7
10
 
@@ -11,7 +11,7 @@ describe FieldStrategy::DateDelta do
11
11
  let(:date_difference) {anonymized_value - field.value}
12
12
 
13
13
  it { anonymized_value.should be_kind_of Date}
14
- it { date_difference.should be_between(-5.days, 5.days) }
14
+ it { date_difference.should be_between(-10.days, 10.days) }
15
15
  end
16
16
 
17
17
  describe 'date should not change when provided with 0 delta for both date and time' do
@@ -6,7 +6,7 @@ describe DataAnon::Strategy::MongoDB::AnonymizeField do
6
6
  it 'should do callback recursive in case of sub document' do
7
7
  sub_document = {'key' => 'value'}
8
8
  field_strategy = {'key' => FieldStrategy::LoremIpsum.new}
9
- anonymization_strategy = mock("AnonymizationStrategy")
9
+ anonymization_strategy = double("AnonymizationStrategy")
10
10
  anonymization_strategy.should_receive(:anonymize_document).with(sub_document,1,field_strategy).and_return({'key' => "anonymized_value"})
11
11
  field = DataAnon::Core::Field.new('sub_document_field', sub_document,1,nil)
12
12
  anonymize_field = DataAnon::Strategy::MongoDB::AnonymizeField.new(field, field_strategy,anonymization_strategy)
@@ -17,7 +17,7 @@ describe DataAnon::Strategy::MongoDB::AnonymizeField do
17
17
  it 'should do callback recursive multiple time in case of array of sub document' do
18
18
  sub_documents = [{'key' => 'value1'},{'key' => 'value2'}]
19
19
  field_strategy = {'key' => FieldStrategy::LoremIpsum.new}
20
- anonymization_strategy = mock("AnonymizationStrategy")
20
+ anonymization_strategy = double("AnonymizationStrategy")
21
21
  anonymization_strategy.should_receive(:anonymize_document).with({'key' => 'value1'},1,field_strategy).and_return({'key' => "anonymized_value1"})
22
22
  anonymization_strategy.should_receive(:anonymize_document).with({'key' => 'value2'},1,field_strategy).and_return({'key' => "anonymized_value2"})
23
23
  field = DataAnon::Core::Field.new('sub_document_field', sub_documents,1,nil)
@@ -29,7 +29,7 @@ describe DataAnon::Strategy::MongoDB::AnonymizeField do
29
29
  end
30
30
 
31
31
  it 'should anonymize array field data type' do
32
- anonymization_strategy = mock("AnonymizationStrategy")
32
+ anonymization_strategy = double("AnonymizationStrategy")
33
33
  anonymization_strategy.should_not_receive(:anonymize_document)
34
34
  field = DataAnon::Core::Field.new('tags',['tag1','tag2'],1,nil)
35
35
  anonymize_field = DataAnon::Strategy::MongoDB::AnonymizeField.new(field,FieldStrategy::SelectFromList.new(['tag4','tag5','tag6','tag7','tag8']),anonymization_strategy)
@@ -40,7 +40,7 @@ describe DataAnon::Strategy::MongoDB::AnonymizeField do
40
40
  end
41
41
 
42
42
  it 'should anonymize field and return anonymized value using passed strategy' do
43
- anonymization_strategy = mock("AnonymizationStrategy")
43
+ anonymization_strategy = double("AnonymizationStrategy")
44
44
  anonymization_strategy.should_not_receive(:anonymize_document)
45
45
  field = DataAnon::Core::Field.new('boolean_field',false,1,nil)
46
46
  anonymize_field = DataAnon::Strategy::MongoDB::AnonymizeField.new(field,FieldStrategy::RandomBoolean.new,anonymization_strategy)
@@ -1,6 +1,6 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
- describe "Utils" do
3
+ describe 'Utils' do
4
4
 
5
5
  before(:each) do
6
6
  source = {:adapter => 'sqlite3', :database => 'sample-data/chinook.sqlite'}
@@ -10,17 +10,16 @@ describe "Utils" do
10
10
  DataAnon::Utils::DestinationDatabase.establish_connection destination
11
11
  end
12
12
 
13
- it "should test the connection to source database" do
14
- album = DataAnon::Utils::SourceTable.create "Album", ["AlbumId"]
13
+ it 'should test the connection to source database' do
14
+ album = DataAnon::Utils::SourceTable.create 'Album', ['AlbumId']
15
15
  album.count.should > 0
16
16
  album.all.length > 0
17
17
  end
18
18
 
19
- it "should test the connection to destination database" do
20
- album = DataAnon::Utils::DestinationTable.create "Album", ["AlbumId"]
19
+ it 'should test the connection to destination database' do
20
+ album = DataAnon::Utils::DestinationTable.create 'Album', ['AlbumId']
21
21
  album.count.should == 0
22
22
  album.all.length == 0
23
-
24
23
  end
25
24
 
26
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data-anonymization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sunit Parekh
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-24 00:00:00.000000000 Z
13
+ date: 2013-12-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -102,28 +102,28 @@ dependencies:
102
102
  requirements:
103
103
  - - ~>
104
104
  - !ruby/object:Gem::Version
105
- version: 0.6.3
105
+ version: 0.9.1
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ~>
111
111
  - !ruby/object:Gem::Version
112
- version: 0.6.3
112
+ version: 0.9.1
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: thor
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ~>
118
118
  - !ruby/object:Gem::Version
119
- version: 0.17.0
119
+ version: 0.18.1
120
120
  type: :runtime
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - ~>
125
125
  - !ruby/object:Gem::Version
126
- version: 0.17.0
126
+ version: 0.18.1
127
127
  description: Data anonymization tool for RDBMS databases
128
128
  email:
129
129
  - parekh.sunit@gmail.com
@@ -134,10 +134,12 @@ executables:
134
134
  extensions: []
135
135
  extra_rdoc_files: []
136
136
  files:
137
+ - .coveralls.yml
137
138
  - .documentup.json
138
139
  - .gitignore
139
140
  - .rspec
140
- - .rvmrc
141
+ - .ruby-gemset
142
+ - .ruby-version
141
143
  - .travis.yml
142
144
  - Gemfile
143
145
  - LICENSE.txt
@@ -276,7 +278,8 @@ files:
276
278
  - spec/utils/random_string_spec.rb
277
279
  - spec/utils/template_helper_spec.rb
278
280
  homepage: http://sunitparekh.github.com/data-anonymization
279
- licenses: []
281
+ licenses:
282
+ - MIT
280
283
  metadata: {}
281
284
  post_install_message:
282
285
  rdoc_options: []
@@ -294,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
297
  version: '0'
295
298
  requirements: []
296
299
  rubyforge_project:
297
- rubygems_version: 2.0.3
300
+ rubygems_version: 2.1.11
298
301
  signing_key:
299
302
  specification_version: 4
300
303
  summary: Tool to create anonymized production data dump to use for PREF and other
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 2.0.0-p0@data-anon --create