my_obfuscate 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +1 -1
- data/.travis.yml +2 -0
- data/lib/my_obfuscate/postgres.rb +1 -1
- data/lib/my_obfuscate/version.rb +1 -1
- data/spec/my_obfuscate/postgres_spec.rb +20 -0
- data/spec/my_obfuscate_spec.rb +1 -1
- metadata +17 -31
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dbec233cd6cde0de00dcdbe9a73f83101cb45f1c
|
4
|
+
data.tar.gz: eceb2de80135082243e460db1b4f2942893a0a74
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f25d3f9af557cfe0073d1e3281fd55b6ebdcde8a6ce3094482f37f08ca27d3ddcd4a2857abd52858be599d4a67dd3fc3b550bc82f48746844d60510310e020bb
|
7
|
+
data.tar.gz: 88c6afd3a7fd91b42a37a233cec81e1b66ce984c12fa6faa91e11fd006aa255e3dff9bfb7583cf85fe831711a5133948610b4165eaabf23d147ee12bacdeaa44
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-1.
|
1
|
+
ruby-2.1.2
|
data/.travis.yml
CHANGED
@@ -10,8 +10,8 @@ class MyObfuscate
|
|
10
10
|
# We wrap it in an array to keep it consistent with MySql bulk
|
11
11
|
# obfuscation (multiple rows per insert statement)
|
12
12
|
def rows_to_be_inserted(line)
|
13
|
-
line.gsub!(/\n$/,"")
|
14
13
|
row = line.split(/\t/)
|
14
|
+
row.last && row.last.strip!
|
15
15
|
|
16
16
|
row.collect! do |value|
|
17
17
|
if value == "\\N"
|
data/lib/my_obfuscate/version.rb
CHANGED
@@ -15,15 +15,35 @@ describe MyObfuscate::Postgres do
|
|
15
15
|
helper.rows_to_be_inserted(line).should == [["1","2","3","4"]]
|
16
16
|
end
|
17
17
|
|
18
|
+
it "doesn't ignore newlines due to empty strings" do
|
19
|
+
line = "1 2 3 \n"
|
20
|
+
helper.rows_to_be_inserted(line).should == [["1","2","3",""]]
|
21
|
+
end
|
22
|
+
|
18
23
|
it "doesn't ignore newline characters in the string" do
|
19
24
|
line = "1 2 3\n4 5"
|
20
25
|
helper.rows_to_be_inserted(line).should == [["1","2","3\n4","5"]]
|
21
26
|
end
|
22
27
|
|
28
|
+
it "preserves empty strings in the middle of the string" do
|
29
|
+
line = "1 2 4"
|
30
|
+
helper.rows_to_be_inserted(line).should == [["1","2","","4"]]
|
31
|
+
end
|
32
|
+
|
33
|
+
it "preserves newline characters in the middle of the string" do
|
34
|
+
line = "1 2 \n 4"
|
35
|
+
helper.rows_to_be_inserted(line).should == [["1","2","\n","4"]]
|
36
|
+
end
|
37
|
+
|
23
38
|
it "replaces \\N with nil" do
|
24
39
|
line = "1 2 \\N 4"
|
25
40
|
helper.rows_to_be_inserted(line).should == [["1","2",nil,"4"]]
|
26
41
|
end
|
42
|
+
|
43
|
+
it "replaces \\N\n with nil" do
|
44
|
+
line = "1 2 3 \\N\n"
|
45
|
+
helper.rows_to_be_inserted(line).should == [["1","2","3",nil]]
|
46
|
+
end
|
27
47
|
end
|
28
48
|
|
29
49
|
describe "#parse_copy_statement" do
|
data/spec/my_obfuscate_spec.rb
CHANGED
@@ -57,7 +57,7 @@ COPY some_table_to_keep (a, b) FROM stdin;
|
|
57
57
|
:age => {:type => :integer, :between => 10...80, :unless => :nil },
|
58
58
|
},
|
59
59
|
:single_column_table => {
|
60
|
-
:id => {:type => :integer, :between =>
|
60
|
+
:id => {:type => :integer, :between => 2..9, :unless => :nil}
|
61
61
|
},
|
62
62
|
:another_table => :truncate,
|
63
63
|
:some_table_to_keep => :keep
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_obfuscate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Andrew Cantino
|
@@ -14,54 +13,48 @@ authors:
|
|
14
13
|
autorequire:
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
|
-
date: 2014-06-
|
16
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
18
17
|
dependencies:
|
19
18
|
- !ruby/object:Gem::Dependency
|
20
19
|
name: ffaker
|
21
20
|
requirement: !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
21
|
requirements:
|
24
|
-
- -
|
22
|
+
- - ">="
|
25
23
|
- !ruby/object:Gem::Version
|
26
24
|
version: '0'
|
27
25
|
type: :runtime
|
28
26
|
prerelease: false
|
29
27
|
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
none: false
|
31
28
|
requirements:
|
32
|
-
- -
|
29
|
+
- - ">="
|
33
30
|
- !ruby/object:Gem::Version
|
34
31
|
version: '0'
|
35
32
|
- !ruby/object:Gem::Dependency
|
36
33
|
name: walker_method
|
37
34
|
requirement: !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
35
|
requirements:
|
40
|
-
- -
|
36
|
+
- - ">="
|
41
37
|
- !ruby/object:Gem::Version
|
42
38
|
version: '0'
|
43
39
|
type: :runtime
|
44
40
|
prerelease: false
|
45
41
|
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
none: false
|
47
42
|
requirements:
|
48
|
-
- -
|
43
|
+
- - ">="
|
49
44
|
- !ruby/object:Gem::Version
|
50
45
|
version: '0'
|
51
46
|
- !ruby/object:Gem::Dependency
|
52
47
|
name: rspec
|
53
48
|
requirement: !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
49
|
requirements:
|
56
|
-
- -
|
50
|
+
- - ">="
|
57
51
|
- !ruby/object:Gem::Version
|
58
52
|
version: '0'
|
59
53
|
type: :development
|
60
54
|
prerelease: false
|
61
55
|
version_requirements: !ruby/object:Gem::Requirement
|
62
|
-
none: false
|
63
56
|
requirements:
|
64
|
-
- -
|
57
|
+
- - ">="
|
65
58
|
- !ruby/object:Gem::Version
|
66
59
|
version: '0'
|
67
60
|
description: Standalone Ruby code for the selective rewriting of MySQL dumps in order
|
@@ -71,10 +64,10 @@ executables: []
|
|
71
64
|
extensions: []
|
72
65
|
extra_rdoc_files: []
|
73
66
|
files:
|
74
|
-
- .gitignore
|
75
|
-
- .ruby-gemset
|
76
|
-
- .ruby-version
|
77
|
-
- .travis.yml
|
67
|
+
- ".gitignore"
|
68
|
+
- ".ruby-gemset"
|
69
|
+
- ".ruby-version"
|
70
|
+
- ".travis.yml"
|
78
71
|
- CHANGES
|
79
72
|
- Gemfile
|
80
73
|
- LICENSE
|
@@ -98,33 +91,26 @@ files:
|
|
98
91
|
- spec/spec_helper.rb
|
99
92
|
homepage: http://github.com/mavenlink/my_obfuscate
|
100
93
|
licenses: []
|
94
|
+
metadata: {}
|
101
95
|
post_install_message:
|
102
96
|
rdoc_options: []
|
103
97
|
require_paths:
|
104
98
|
- lib
|
105
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
100
|
requirements:
|
108
|
-
- -
|
101
|
+
- - ">="
|
109
102
|
- !ruby/object:Gem::Version
|
110
103
|
version: '0'
|
111
|
-
segments:
|
112
|
-
- 0
|
113
|
-
hash: -128006069281538944
|
114
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
-
none: false
|
116
105
|
requirements:
|
117
|
-
- -
|
106
|
+
- - ">="
|
118
107
|
- !ruby/object:Gem::Version
|
119
108
|
version: '0'
|
120
|
-
segments:
|
121
|
-
- 0
|
122
|
-
hash: -128006069281538944
|
123
109
|
requirements: []
|
124
110
|
rubyforge_project:
|
125
|
-
rubygems_version:
|
111
|
+
rubygems_version: 2.2.2
|
126
112
|
signing_key:
|
127
|
-
specification_version:
|
113
|
+
specification_version: 4
|
128
114
|
summary: Standalone Ruby code for the selective rewriting of MySQL dumps in order
|
129
115
|
to protect user privacy.
|
130
116
|
test_files:
|