confidential_info_redactor 0.0.16 → 0.0.17
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecd015cf09c8a3ba3720771d28d52a4f39335668
|
4
|
+
data.tar.gz: 5e165e1a0966908310d313f548262413f82df683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efeac3a7016d3fd3623083b8690f69acf1329eee2307bbdad43c27d74317a22482f66001f1851aa0851307180f54811640a959760c6bbcb69b181775a6539965
|
7
|
+
data.tar.gz: 0ae010f93fa7238ae93ce94813ee2636e9e35bdcce454c38d4cdc76f45b32cf3ed90fadbffccab79741e7f7ef5c9e3c033c3ab9eefc3d3d59c372ac29e24ed84
|
@@ -71,6 +71,7 @@ module ConfidentialInfoRedactor
|
|
71
71
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
72
72
|
.gsub(/\d{4}(\.|-|\/)*#{Regexp.escape(month)}(\.|-|\/)*\d+/i, ' <redacted date> ')
|
73
73
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
74
|
+
.gsub(/#{Regexp.escape(month)}\sde\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
74
75
|
end
|
75
76
|
months_abbr.each do |month|
|
76
77
|
new_string = new_string.gsub(/#{Regexp.escape(day)}(,)*\s#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
@@ -79,6 +80,7 @@ module ConfidentialInfoRedactor
|
|
79
80
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
80
81
|
.gsub(/\d{4}(\.|-|\/)*#{Regexp.escape(month)}(\.|-|\/)*\d+/i, ' <redacted date> ')
|
81
82
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
83
|
+
.gsub(/#{Regexp.escape(month)}\sde\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
82
84
|
end
|
83
85
|
end
|
84
86
|
else
|
@@ -90,6 +92,7 @@ module ConfidentialInfoRedactor
|
|
90
92
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
91
93
|
.gsub(/\d{4}(\.|-|\/)*#{Regexp.escape(month)}(\.|-|\/)*\d+/i, ' <redacted date> ')
|
92
94
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
95
|
+
.gsub(/#{Regexp.escape(month)}\sde\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
93
96
|
end
|
94
97
|
months_abbr.each do |month|
|
95
98
|
new_string = new_string.gsub(/#{Regexp.escape(day)}(,)*\s#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
@@ -98,6 +101,7 @@ module ConfidentialInfoRedactor
|
|
98
101
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
99
102
|
.gsub(/\d{4}(\.|-|\/)*#{Regexp.escape(month)}(\.|-|\/)*\d+/i, ' <redacted date> ')
|
100
103
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
104
|
+
.gsub(/#{Regexp.escape(month)}\sde\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
101
105
|
end
|
102
106
|
end
|
103
107
|
dow_abbr.each do |day|
|
@@ -260,6 +260,12 @@ RSpec.describe ConfidentialInfoRedactor::Date do
|
|
260
260
|
ws = ConfidentialInfoRedactor::Date.new(string: string, language: 'de')
|
261
261
|
expect(ws.replace).to eq(' <redacted date> ')
|
262
262
|
end
|
263
|
+
|
264
|
+
it 'replaces the date occurences in a string #002' do
|
265
|
+
string = 'Oktober de 15'
|
266
|
+
ws = ConfidentialInfoRedactor::Date.new(string: string, language: 'de')
|
267
|
+
expect(ws.replace).to eq(' <redacted date> ')
|
268
|
+
end
|
263
269
|
end
|
264
270
|
end
|
265
271
|
|