confidential_info_redactor_lite 0.0.21 → 0.0.22
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: 682e05652920a3ab0cf26e3f456f37ede910c268
|
4
|
+
data.tar.gz: 31d2cc997634e60820697d9d5574300c70e1db6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a18daa3439b0aa335231bfc8a0cdcb1500097ad00a291928e397271ff491f7a2a49e25c9e14803cfd3366d750e77cf387a22413fbd0c56a212e1b1eeaf54ba0
|
7
|
+
data.tar.gz: dd11d3fabbddc375d91069447441952183d5dc443bfac00573066405a81fad8cb396d420af2546c250de48aeb697f74c53752a5433f700796b6f66c272ecd339
|
@@ -49,6 +49,7 @@ module ConfidentialInfoRedactorLite
|
|
49
49
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
50
50
|
.gsub(/\d{4}(\.|-|\/)*#{Regexp.escape(month)}(\.|-|\/)*\d+/i, ' <redacted date> ')
|
51
51
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
52
|
+
.gsub(/#{Regexp.escape(month)}\sde\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
52
53
|
end
|
53
54
|
months_abbr.each do |month|
|
54
55
|
new_string = new_string.gsub(/#{Regexp.escape(day)}(,)*\s#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
@@ -57,6 +58,7 @@ module ConfidentialInfoRedactorLite
|
|
57
58
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
58
59
|
.gsub(/\d{4}(\.|-|\/)*#{Regexp.escape(month)}(\.|-|\/)*\d+/i, ' <redacted date> ')
|
59
60
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
61
|
+
.gsub(/#{Regexp.escape(month)}\sde\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
60
62
|
end
|
61
63
|
end
|
62
64
|
else
|
@@ -68,6 +70,7 @@ module ConfidentialInfoRedactorLite
|
|
68
70
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
69
71
|
.gsub(/\d{4}(\.|-|\/)*#{Regexp.escape(month)}(\.|-|\/)*\d+/i, ' <redacted date> ')
|
70
72
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
73
|
+
.gsub(/#{Regexp.escape(month)}\sde\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
71
74
|
end
|
72
75
|
months_abbr.each do |month|
|
73
76
|
new_string = new_string.gsub(/#{Regexp.escape(day)}(,)*\s#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
@@ -76,6 +79,7 @@ module ConfidentialInfoRedactorLite
|
|
76
79
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
77
80
|
.gsub(/\d{4}(\.|-|\/)*#{Regexp.escape(month)}(\.|-|\/)*\d+/i, ' <redacted date> ')
|
78
81
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
82
|
+
.gsub(/#{Regexp.escape(month)}\sde\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
79
83
|
end
|
80
84
|
end
|
81
85
|
dow_abbr.each do |day|
|
@@ -270,6 +270,12 @@ RSpec.describe ConfidentialInfoRedactorLite::Date do
|
|
270
270
|
ws = ConfidentialInfoRedactorLite::Date.new(string: string, dow: de_dow, dow_abbr: de_dow_abbr, months: de_months, months_abbr: de_month_abbr)
|
271
271
|
expect(ws.replace).to eq(' <redacted date> ')
|
272
272
|
end
|
273
|
+
|
274
|
+
it 'replaces the date occurences in a string #002' do
|
275
|
+
string = 'Oktober de 15'
|
276
|
+
ws = ConfidentialInfoRedactorLite::Date.new(string: string, dow: de_dow, dow_abbr: de_dow_abbr, months: de_months, months_abbr: de_month_abbr)
|
277
|
+
expect(ws.replace).to eq(' <redacted date> ')
|
278
|
+
end
|
273
279
|
end
|
274
280
|
end
|
275
281
|
|