witsec 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +7 -1
- data/lib/witsec/anonymizer.rb +10 -0
- data/lib/witsec/version.rb +1 -1
- data/lib/witsec.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9efdb6fa50bf7dfccc53c018e720fba3ecca0bc700f030f3a094782bae65cd6
|
4
|
+
data.tar.gz: 57d8ff0a76ae65f6069d375877ba5d46c4a85f23f3378d3448b5d221f8fcbf40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fb14f542f8044531e8197907cacb81920cdc49443fc19bd6082496e271e051f41e6ae04ff80218cae72700f25f06a60b407ffc10f18c57a4c85fc73d8c1ff6f
|
7
|
+
data.tar.gz: 260e6e6467b1f8888fdb9779cc1d534cd7f069060a25722a6f9e8c37149d33a04f9fc1dd21b990e7150dbd6201b8db879d34b5f6fa3a6df53d7eaf96d07691d6
|
data/Rakefile
CHANGED
data/lib/witsec/anonymizer.rb
CHANGED
@@ -4,6 +4,8 @@ module Witsec
|
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
@schema = instance_eval(File.read("config/witsec/schema.rb"))
|
7
|
+
|
8
|
+
check_input_and_output_are_different
|
7
9
|
end
|
8
10
|
|
9
11
|
attr_reader :schema
|
@@ -74,6 +76,14 @@ module Witsec
|
|
74
76
|
|
75
77
|
private
|
76
78
|
|
79
|
+
def check_input_and_output_are_different
|
80
|
+
return if Rails.env.test?
|
81
|
+
|
82
|
+
if input_connection_pool.lease_connection.current_database == output_connection_pool.lease_connection.current_database
|
83
|
+
raise Witsec::InputAndOutputDatabasesAreTheSame, "You've probably forgotten to setup the output database. It must be named anonymized."
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
77
87
|
def input_database_configuration
|
78
88
|
Rails.configuration.database_configuration[Rails.env]["primary"]
|
79
89
|
end
|
data/lib/witsec/version.rb
CHANGED
data/lib/witsec.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: witsec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolai Bach Woller
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
|
-
rubygems_version: 3.6.
|
105
|
+
rubygems_version: 3.6.7
|
106
106
|
specification_version: 4
|
107
107
|
summary: Anonymize your database for dumping
|
108
108
|
test_files: []
|