data-anonymization 0.8.3 → 0.8.7

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
  SHA256:
3
- metadata.gz: dc0216d076506f27de3825ea3afe3fe882589a34ca7ee9bf093299c3d94dbab5
4
- data.tar.gz: 1abba846e6f447480c72ac18d49ffffc7f2ad1ee861a4e43016224ed00690f49
3
+ metadata.gz: 8dd6cd4c88130c0107c37fdadf96b9c988433c43c52b7fa7b6b5a753717b045b
4
+ data.tar.gz: 51f8b7fd6e666c0f5c2438430d01a657868a5c97a062b46dce1e3f21a3cd88e8
5
5
  SHA512:
6
- metadata.gz: 522f6c119710060fa7dacb9056bb6671d890f6057b9abb63bb78d06c3c1defd8de4ec33b8cbb1ec463385260c1a7d8f6722980353c4382fcebca6720db9a7859
7
- data.tar.gz: be0be6df490fac97beaed277eda3c89d9d5b92c72e64bd5cef5e381ea66a58cf1664fe753f9a803953f54457a2f4762b6de4e72ae0756693038e89a9ba7c2abb
6
+ metadata.gz: 04254c1498d44ef75efd355181cf1dd8cfaf782ea4d42b3a97d27f0e2a6d513c96981546a667dcd875df9417f1bd6cff2f32cbedaf973688c216d4ca7ac2f464
7
+ data.tar.gz: c954f6aeb3f0774c49d14d354d1144a8edd8516685ff71da908ababf5488e0f8874a5abf56a351a10609095525099050bac469e688bd3c84ec0dae858bc81ad7
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.5.3
1
+ ruby-3.1.0
data/.travis.yml CHANGED
@@ -4,6 +4,5 @@ services:
4
4
  before_install: gem install bundler
5
5
  before_script: rake empty_dest
6
6
  rvm:
7
- - 2.3.8
8
- - 2.4.5
9
- - 2.5.3
7
+ - 2.7.5
8
+ - 3.1.0
data/README.md CHANGED
@@ -81,6 +81,9 @@ Postgresql database having **composite primary key**
81
81
 
82
82
  ## Changelog
83
83
 
84
+ #### 0.8.5 (May 28, 2020)
85
+ 1. Upgraded to rails 6.x
86
+
84
87
  #### 0.8.1 (Aug 19, 2017)
85
88
  1. Multi-threading support added by [stanislav-tyutin](https://github.com/stanislav-tyutin) using Pull Request.
86
89
  2. Fixed to work with Ruby 2.4.x, issue with Integer data type
@@ -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.2')
23
- gem.add_dependency('composite_primary_keys', '~> 11.0')
24
- gem.add_dependency('activesupport', '~> 5.2')
25
- gem.add_dependency('rgeo', '~> 1.0')
26
- gem.add_dependency('rgeo-geojson', '~> 2.0')
27
- gem.add_dependency('powerbar', '~> 1.0')
28
- gem.add_dependency('parallel', '~> 1.12')
29
- gem.add_dependency('thor', '~> 0.20.3')
22
+ gem.add_dependency('activerecord', '~> 7.0')
23
+ gem.add_dependency('activesupport', '~> 7.0')
24
+ gem.add_dependency('composite_primary_keys', '~> 14.0')
25
+ gem.add_dependency('parallel', '~> 1.21')
26
+ gem.add_dependency('powerbar', '~> 2.0')
27
+ gem.add_dependency('rgeo', '~> 2.3')
28
+ gem.add_dependency('rgeo-geojson', '~> 2.1')
29
+ gem.add_dependency('thor', '~> 1.1')
30
30
  end
@@ -58,8 +58,8 @@ module DataAnon
58
58
  month = @anonymize_month? DataAnon::Utils::RandomInt.generate(1,12) : original_time.month
59
59
  days_in_month = Time.new(year,month,1,1,1,1).end_of_month.day
60
60
  day = @anonymize_day? DataAnon::Utils::RandomInt.generate(1,days_in_month) : original_time.day
61
- hour = @anonymize_hour? DataAnon::Utils::RandomInt.generate(1,24) : original_time.hour
62
- min = @anonymize_min? DataAnon::Utils::RandomInt.generate(1,60) : original_time.min
61
+ hour = @anonymize_hour? DataAnon::Utils::RandomInt.generate(0,23) : original_time.hour
62
+ min = @anonymize_min? DataAnon::Utils::RandomInt.generate(0,59) : original_time.min
63
63
  sec = original_time.sec
64
64
 
65
65
  create_object(year, month, day, hour, min, sec)
@@ -74,4 +74,4 @@ module DataAnon
74
74
  end
75
75
  end
76
76
  end
77
- end
77
+ end
@@ -16,7 +16,7 @@ module DataAnon
16
16
  end
17
17
 
18
18
  def anonymize field
19
- return BigDecimal.new("#{field.value + DataAnon::Utils::RandomFloat.generate(-@delta, +@delta)}")
19
+ return BigDecimal("#{field.value + DataAnon::Utils::RandomFloat.generate(-@delta, +@delta)}")
20
20
  end
21
21
 
22
22
  end
@@ -25,7 +25,7 @@ module DataAnon
25
25
 
26
26
  def self.create_table database, table_name, primary_keys = []
27
27
  klass_name = table_name.to_s.downcase.capitalize
28
- return database.const_get klass_name if database.const_defined? klass_name
28
+ return database.const_get(klass_name, false) if database.const_defined?(klass_name, false)
29
29
  database.const_set(klass_name, Class.new(database) do
30
30
  self.table_name = table_name
31
31
  self.primary_keys = primary_keys if primary_keys.length > 1
@@ -4,8 +4,8 @@ module DataAnon
4
4
 
5
5
  def self.generate min, max
6
6
  return 0 if (min == 0 && max == 0)
7
- Random.new.rand min...max
7
+ Random.new.rand min..max
8
8
  end
9
9
  end
10
10
  end
11
- end
11
+ end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DataAnonymization
2
- VERSION = '0.8.3'
2
+ VERSION = '0.8.7'
3
3
  end
@@ -4,7 +4,7 @@ require 'bigdecimal'
4
4
  describe FieldStrategy::RandomBigDecimalDelta do
5
5
 
6
6
  RandomBigDecimalDelta = FieldStrategy::RandomBigDecimalDelta
7
- let(:field) {DataAnon::Core::Field.new('decimal_field',BigDecimal.new("53422342378687687342893.23324"),1,nil)}
7
+ let(:field) {DataAnon::Core::Field.new('decimal_field',BigDecimal("53422342378687687342893.23324"),1,nil)}
8
8
 
9
9
  describe 'anonymized big decimal should not be the same as original value' do
10
10
  let(:anonymized_value) {RandomBigDecimalDelta.new.anonymize(field)}
@@ -1,8 +1,8 @@
1
1
  class CustomerSample
2
2
 
3
- class CreateCustomer < ActiveRecord::Migration[5.0]
3
+ class CreateCustomer < ActiveRecord::Migration[7.0]
4
4
  def up
5
- create_table :customers, { :id => false, :force => true } do |t|
5
+ create_table :customers, :id => false, :force => true do |t|
6
6
  t.integer :cust_id, :primary => true
7
7
  t.string :first_name
8
8
  t.string :last_name
@@ -16,10 +16,10 @@ describe 'Utils' do
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']
21
- album.count.should == 0
22
- album.all.length == 0
19
+ it 'ignores inherited constants when creating a table with matching name' do
20
+ conditionals = DataAnon::Utils::SourceTable.create 'Conditionals'
21
+ conditionals.count.should == 0
22
+ conditionals.all.length == 0
23
23
  end
24
24
 
25
25
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data-anonymization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sunit Parekh
8
8
  - Anand Agrawal
9
9
  - Satyam Agarwala
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-11-10 00:00:00.000000000 Z
13
+ date: 2022-01-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -18,58 +18,58 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '5.2'
21
+ version: '7.0'
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.2'
28
+ version: '7.0'
29
29
  - !ruby/object:Gem::Dependency
30
- name: composite_primary_keys
30
+ name: activesupport
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '11.0'
35
+ version: '7.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: '11.0'
42
+ version: '7.0'
43
43
  - !ruby/object:Gem::Dependency
44
- name: activesupport
44
+ name: composite_primary_keys
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '5.2'
49
+ version: '14.0'
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.2'
56
+ version: '14.0'
57
57
  - !ruby/object:Gem::Dependency
58
- name: rgeo
58
+ name: parallel
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '1.0'
63
+ version: '1.21'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '1.0'
70
+ version: '1.21'
71
71
  - !ruby/object:Gem::Dependency
72
- name: rgeo-geojson
72
+ name: powerbar
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
@@ -83,47 +83,47 @@ dependencies:
83
83
  - !ruby/object:Gem::Version
84
84
  version: '2.0'
85
85
  - !ruby/object:Gem::Dependency
86
- name: powerbar
86
+ name: rgeo
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: '1.0'
91
+ version: '2.3'
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: '1.0'
98
+ version: '2.3'
99
99
  - !ruby/object:Gem::Dependency
100
- name: parallel
100
+ name: rgeo-geojson
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: '1.12'
105
+ version: '2.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: '1.12'
112
+ version: '2.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.20.3
119
+ version: '1.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.20.3
126
+ version: '1.1'
127
127
  description: Data anonymization tool for RDBMS and MongoDB databases
128
128
  email:
129
129
  - parekh.sunit@gmail.com
@@ -283,7 +283,7 @@ homepage: http://sunitparekh.github.com/data-anonymization
283
283
  licenses:
284
284
  - MIT
285
285
  metadata: {}
286
- post_install_message:
286
+ post_install_message:
287
287
  rdoc_options: []
288
288
  require_paths:
289
289
  - lib
@@ -298,9 +298,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  requirements: []
301
- rubyforge_project:
302
- rubygems_version: 2.7.6
303
- signing_key:
301
+ rubygems_version: 3.3.3
302
+ signing_key:
304
303
  specification_version: 4
305
304
  summary: Tool to create anonymized production data dump to use for performance and
306
305
  testing environments.