data-anonymization 0.8.2 → 0.8.3

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
- SHA1:
3
- metadata.gz: ea71406f4d69385841297c63312abbfe0a1ded34
4
- data.tar.gz: 6309e4f2155021c42c80aa561dc5ddd2cd4999f7
2
+ SHA256:
3
+ metadata.gz: dc0216d076506f27de3825ea3afe3fe882589a34ca7ee9bf093299c3d94dbab5
4
+ data.tar.gz: 1abba846e6f447480c72ac18d49ffffc7f2ad1ee861a4e43016224ed00690f49
5
5
  SHA512:
6
- metadata.gz: 6e3fde8664f03c76c8939e14899dc0ded79559e6b016ebdc966b2a6095964b3f1888286f4c09a0a42226d4a475a905e8249f5a9463530c87592455432f36a4f3
7
- data.tar.gz: 407caf0cec3c9962efa62272493b80cdf65acdcd49c33e799546419cad94157456733fad89a28f0c8523e1d92902193e2511f6d1fff98dff4a1194d68b4fc45c
6
+ metadata.gz: 522f6c119710060fa7dacb9056bb6671d890f6057b9abb63bb78d06c3c1defd8de4ec33b8cbb1ec463385260c1a7d8f6722980353c4382fcebca6720db9a7859
7
+ data.tar.gz: be0be6df490fac97beaed277eda3c89d9d5b92c72e64bd5cef5e381ea66a58cf1664fe753f9a803953f54457a2f4762b6de4e72ae0756693038e89a9ba7c2abb
@@ -1 +1 @@
1
- ruby-2.4.1
1
+ ruby-2.5.3
@@ -1,9 +1,9 @@
1
1
  language: ruby
2
2
  services:
3
3
  - mongodb
4
- before_install: gem install bundler -v 1.15.3
4
+ before_install: gem install bundler
5
5
  before_script: rake empty_dest
6
6
  rvm:
7
- - 2.2.6
8
- - 2.3.3
9
- - 2.4.1
7
+ - 2.3.8
8
+ - 2.4.5
9
+ - 2.5.3
@@ -0,0 +1,4 @@
1
+ bundle update
2
+ bundle outdated
3
+
4
+ bundle exec rake
@@ -19,12 +19,12 @@ Gem::Specification.new do |gem|
19
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
20
  gem.require_paths = ['lib']
21
21
 
22
- gem.add_dependency('activerecord', '~> 5.1')
23
- gem.add_dependency('composite_primary_keys', '~> 10.0')
24
- gem.add_dependency('activesupport', '~> 5.1')
22
+ gem.add_dependency('activerecord', '~> 5.2')
23
+ gem.add_dependency('composite_primary_keys', '~> 11.0')
24
+ gem.add_dependency('activesupport', '~> 5.2')
25
25
  gem.add_dependency('rgeo', '~> 1.0')
26
26
  gem.add_dependency('rgeo-geojson', '~> 2.0')
27
27
  gem.add_dependency('powerbar', '~> 1.0')
28
28
  gem.add_dependency('parallel', '~> 1.12')
29
- gem.add_dependency('thor', '~> 0.20')
29
+ gem.add_dependency('thor', '~> 0.20.3')
30
30
  end
@@ -3,15 +3,16 @@ module DataAnon
3
3
  class Blacklist < DataAnon::Strategy::Base
4
4
 
5
5
  def process_record index, record
6
+ updates = {}
6
7
  @fields.each do |field, strategy|
7
8
  database_field_name = record.attributes.select { |k,v| k == field }.keys[0]
8
9
  field_value = record.attributes[database_field_name]
9
10
  unless field_value.nil? || is_primary_key?(database_field_name)
10
11
  field = DataAnon::Core::Field.new(database_field_name, field_value, index, record, @name)
11
- record[database_field_name] = strategy.anonymize(field)
12
+ updates[database_field_name] = strategy.anonymize(field)
12
13
  end
13
14
  end
14
- record.save!
15
+ record.update_columns(updates) if updates.any?
15
16
  end
16
17
 
17
18
  end
@@ -1,3 +1,3 @@
1
1
  module DataAnonymization
2
- VERSION = '0.8.2'
2
+ VERSION = '0.8.3'
3
3
  end
@@ -95,7 +95,7 @@ describe 'End 2 End MongoDB Whitelist Acceptance Test' do
95
95
  feature1 = plan['features'][0]
96
96
  [10737418240, 21474836480, 53687091200].should include(feature1['max_storage'])
97
97
  feature1['type'].should == 'AmazonS3'
98
- feature1['users']['max'].should be_kind_of(Fixnum)
98
+ feature1['users']['max'].should be_kind_of(Integer)
99
99
  [true,false].should include(feature1['users']['additional'])
100
100
 
101
101
 
@@ -29,14 +29,14 @@ describe FieldStrategy::DefaultAnon do
29
29
  let(:field) {DataAnon::Core::Field.new('int_field',2,1,nil)}
30
30
  let(:anonymized_value) {DefaultAnon.new.anonymize(field)}
31
31
 
32
- it { anonymized_value.should be_kind_of Fixnum }
32
+ it { anonymized_value.should be_kind_of Integer }
33
33
  end
34
34
 
35
35
  describe 'anonymized bignum value' do
36
36
  let(:field) {DataAnon::Core::Field.new('int_field',2348723489723847382947,1,nil)}
37
37
  let(:anonymized_value) {DefaultAnon.new.anonymize(field)}
38
38
 
39
- it { anonymized_value.should be_kind_of Bignum }
39
+ it { anonymized_value.should be_kind_of Integer }
40
40
  end
41
41
 
42
42
  describe 'anonymized string value' do
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.8.2
4
+ version: 0.8.3
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: 2018-03-07 00:00:00.000000000 Z
13
+ date: 2018-11-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -18,42 +18,42 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '5.1'
21
+ version: '5.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '5.1'
28
+ version: '5.2'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: composite_primary_keys
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '10.0'
35
+ version: '11.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '10.0'
42
+ version: '11.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: activesupport
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '5.1'
49
+ version: '5.2'
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '5.1'
56
+ version: '5.2'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rgeo
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -116,14 +116,14 @@ dependencies:
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '0.20'
119
+ version: 0.20.3
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.20'
126
+ version: 0.20.3
127
127
  description: Data anonymization tool for RDBMS and MongoDB databases
128
128
  email:
129
129
  - parekh.sunit@gmail.com
@@ -146,6 +146,7 @@ files:
146
146
  - README.md
147
147
  - Rakefile
148
148
  - bin/datanon
149
+ - commands.txt
149
150
  - data-anonymization.gemspec
150
151
  - examples/blacklist_dsl.rb
151
152
  - examples/mongodb_blacklist_dsl.rb
@@ -298,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
299
  version: '0'
299
300
  requirements: []
300
301
  rubyforge_project:
301
- rubygems_version: 2.6.12
302
+ rubygems_version: 2.7.6
302
303
  signing_key:
303
304
  specification_version: 4
304
305
  summary: Tool to create anonymized production data dump to use for performance and