data-anonymization 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/commands.txt +14 -1
- data/data-anonymization.gemspec +1 -0
- data/lib/thor/helpers/rdbms_dsl_generator.rb +8 -13
- data/lib/thor/templates/whitelist_template.erb +2 -2
- data/lib/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 956533e107fbde4fc664b5326a5f9672a6d1f1edc32088aa65cc7f5c0d6c7616
|
4
|
+
data.tar.gz: 728109a62c6c2512fc6832181f8c3ce03693c373cbc89ae75ca2f11196cf0a83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cf107a2028bd58a582ecdefdf281a217a763fe6c9b75063432dbe930588889e19815ae0a9daa32da72e31560e772a8a4d815d350904ef5bad974ded55a2f530
|
7
|
+
data.tar.gz: 92d9eb3607b60c928328a6a43f4de48f4c6e23b6db8c95a2d821219387486110c80504d1fed893c79723c7e3bb4d9ccda3dcb3147b382f60477f9d6a6d5cc4bb
|
data/README.md
CHANGED
@@ -81,10 +81,12 @@ Postgresql database having **composite primary key**
|
|
81
81
|
|
82
82
|
## Changelog
|
83
83
|
|
84
|
+
#### 0.9.0 (Jan 29, 2025)
|
85
|
+
1. Fixed issue with connection pool
|
86
|
+
|
84
87
|
#### 0.9.0 (Dec 24, 2024)
|
85
88
|
1. Upgraded to rails 8.0
|
86
89
|
|
87
|
-
|
88
90
|
#### 0.8.10 (Mar 20, 2024)
|
89
91
|
1. Upgraded to rails 7.1
|
90
92
|
|
data/commands.txt
CHANGED
@@ -1,8 +1,21 @@
|
|
1
1
|
rbenv exec bundle update
|
2
2
|
rbenv exec bundle outdated
|
3
3
|
|
4
|
+
# run tests
|
4
5
|
rbenv exec bundle exec rake
|
5
6
|
|
7
|
+
# start mongodb database
|
8
|
+
mongod --dbpath ./data
|
6
9
|
|
7
10
|
|
8
|
-
|
11
|
+
# git commands
|
12
|
+
git pull --rebase
|
13
|
+
git add .
|
14
|
+
git commit -m "upgraded to ActiveRecord and ActiveSupport 8.0"
|
15
|
+
git push
|
16
|
+
|
17
|
+
|
18
|
+
# ruby gemspec commands
|
19
|
+
gem build data-anonymization.gemspec
|
20
|
+
gem push data-anonymization-0.9.1.gem
|
21
|
+
|
data/data-anonymization.gemspec
CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.summary = %q{Tool to create anonymized production data dump to use for performance and testing environments.}
|
13
13
|
gem.homepage = 'http://sunitparekh.github.com/data-anonymization'
|
14
14
|
gem.license = 'MIT'
|
15
|
+
gem.required_ruby_version = '>= 3.0'
|
15
16
|
|
16
17
|
|
17
18
|
gem.files = `git ls-files`.split($/).select { |f| !f.match(/^sample-data/) }
|
@@ -1,36 +1,31 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "thor"
|
2
|
+
require "active_record"
|
3
|
+
require "erb"
|
4
4
|
|
5
5
|
module DataAnon
|
6
6
|
module ThorHelpers
|
7
7
|
class RDBMSDSLGenerator
|
8
|
-
|
9
8
|
def self.source_root
|
10
9
|
File.dirname(__FILE__)
|
11
10
|
end
|
12
11
|
|
13
12
|
def generate_whitelist_script(configuration_hash)
|
14
|
-
|
15
13
|
@configuration_hash = configuration_hash
|
16
|
-
|
14
|
+
connection_pool = ActiveRecord::Base.establish_connection(@configuration_hash)
|
15
|
+
@connection = connection_pool.lease_connection
|
17
16
|
|
18
|
-
@tables = @
|
17
|
+
@tables = @connection.tables
|
19
18
|
|
20
|
-
erb = ERB.new(
|
19
|
+
erb = ERB.new(File.new(RDBMSDSLGenerator.source_root + "/../templates/whitelist_template.erb").read, trim_mode: "-")
|
21
20
|
|
22
|
-
File.open(
|
21
|
+
File.open("rdbms_whitelist_generated.rb", "w") do |f|
|
23
22
|
f.write erb.result(binding)
|
24
23
|
f.close
|
25
24
|
end
|
26
|
-
|
27
25
|
rescue => e
|
28
26
|
puts "\e[31mActiverecord was unable to establish a connection to the specified database. Please check the configuration options and try again.\e[0m"
|
29
27
|
puts e.backtrace
|
30
28
|
end
|
31
|
-
|
32
29
|
end
|
33
30
|
end
|
34
31
|
end
|
35
|
-
|
36
|
-
|
@@ -10,8 +10,8 @@ database 'Template' do
|
|
10
10
|
|
11
11
|
<% @tables.each do |table| %>
|
12
12
|
table '<%= table %>' do
|
13
|
-
primary_key '<%= @
|
14
|
-
<%- @
|
13
|
+
primary_key '<%= @connection.primary_key("#{table}").nil? ? "<No primary key found. Possible composite key. Please enter the value>" : @connection.primary_key("#{table}") %>'
|
14
|
+
<%- @connection.indexes("#{table}").each do |index| -%>
|
15
15
|
whitelist '<%= index.columns.first %>'
|
16
16
|
<%- end -%>
|
17
17
|
end
|
data/lib/version.rb
CHANGED
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.9.
|
4
|
+
version: 0.9.1
|
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:
|
13
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -269,7 +269,7 @@ homepage: http://sunitparekh.github.com/data-anonymization
|
|
269
269
|
licenses:
|
270
270
|
- MIT
|
271
271
|
metadata: {}
|
272
|
-
post_install_message:
|
272
|
+
post_install_message:
|
273
273
|
rdoc_options: []
|
274
274
|
require_paths:
|
275
275
|
- lib
|
@@ -277,15 +277,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
277
|
requirements:
|
278
278
|
- - ">="
|
279
279
|
- !ruby/object:Gem::Version
|
280
|
-
version: '0'
|
280
|
+
version: '3.0'
|
281
281
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
282
282
|
requirements:
|
283
283
|
- - ">="
|
284
284
|
- !ruby/object:Gem::Version
|
285
285
|
version: '0'
|
286
286
|
requirements: []
|
287
|
-
rubygems_version: 3.
|
288
|
-
signing_key:
|
287
|
+
rubygems_version: 3.5.22
|
288
|
+
signing_key:
|
289
289
|
specification_version: 4
|
290
290
|
summary: Tool to create anonymized production data dump to use for performance and
|
291
291
|
testing environments.
|