confidential_info_redactor_lite 0.0.30 → 0.0.31
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: e4392706f3a5e307a5453009fadcf4010a7162da
|
4
|
+
data.tar.gz: 107759c2fd4bbe553f6389bb4c419698c0513285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77ea54f659ac2a4e340fa55ac5afc558d0e6807630c1b646554da52a3a0a88f138c9db932d92b86e06b7334b79ea91b97b93011d1afea055a427953d148d55cf
|
7
|
+
data.tar.gz: 62c0fd961e7ab69fb571f5ab5edae83d736feb1bf81a77d33195ad7c3fdfe7e5cd99ccb2a2dc5c65e0e49e6a0da0c009ce362ac854aa93ffe0b576ccd91f0369
|
@@ -50,6 +50,7 @@ module ConfidentialInfoRedactorLite
|
|
50
50
|
dow.each do |day|
|
51
51
|
months.each do |month|
|
52
52
|
new_string = new_string.gsub(/#{Regexp.escape(day)}(,)*\s#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
53
|
+
.gsub(/\d+\s+de\s+#{Regexp.escape(month)}\s\d{4}/i, ' <redacted date> ')
|
53
54
|
.gsub(/\d{2}(\.|-|\/)*\s?#{Regexp.escape(month)}(\.|-|\/)*\s?(\d{4}|\d{2})/i, ' <redacted date> ')
|
54
55
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
55
56
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
@@ -59,6 +60,7 @@ module ConfidentialInfoRedactorLite
|
|
59
60
|
end
|
60
61
|
months_abbr.each do |month|
|
61
62
|
new_string = new_string.gsub(/#{Regexp.escape(day)}(,)*\s#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
63
|
+
.gsub(/\d+\s+de\s+#{Regexp.escape(month)}\s\d{4}/i, ' <redacted date> ')
|
62
64
|
.gsub(/\d{2}(\.|-|\/)*\s?#{Regexp.escape(month)}(\.|-|\/)*\s?(\d{4}|\d{2})/i, ' <redacted date> ')
|
63
65
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
64
66
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
@@ -71,6 +73,7 @@ module ConfidentialInfoRedactorLite
|
|
71
73
|
dow.each do |day|
|
72
74
|
months.each do |month|
|
73
75
|
new_string = new_string.gsub(/#{Regexp.escape(day)}(,)*\s#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
76
|
+
.gsub(/\d+\s+de\s+#{Regexp.escape(month)}\s\d{4}/i, ' <redacted date> ')
|
74
77
|
.gsub(/\d{2}(\.|-|\/)*\s?#{Regexp.escape(month)}(\.|-|\/)*\s?(\d{4}|\d{2})/i, ' <redacted date> ')
|
75
78
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
76
79
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
@@ -80,6 +83,7 @@ module ConfidentialInfoRedactorLite
|
|
80
83
|
end
|
81
84
|
months_abbr.each do |month|
|
82
85
|
new_string = new_string.gsub(/#{Regexp.escape(day)}(,)*\s#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
86
|
+
.gsub(/\d+\s+de\s+#{Regexp.escape(month)}\s\d{4}/i, ' <redacted date> ')
|
83
87
|
.gsub(/\d{2}(\.|-|\/)*\s?#{Regexp.escape(month)}(\.|-|\/)*\s?(\d{4}|\d{2})/i, ' <redacted date> ')
|
84
88
|
.gsub(/#{Regexp.escape(month)}(\.)*\s\d+(rd|th|st)*(,)*\s\d{4}/i, ' <redacted date> ')
|
85
89
|
.gsub(/\d{4}\.*\s#{Regexp.escape(month)}\s\d+(rd|th|st)*/i, ' <redacted date> ')
|
@@ -281,6 +281,12 @@ RSpec.describe ConfidentialInfoRedactorLite::Date do
|
|
281
281
|
ws = ConfidentialInfoRedactorLite::Date.new(string: string, dow: de_dow, dow_abbr: de_dow_abbr, months: de_months, months_abbr: de_month_abbr)
|
282
282
|
expect(ws.replace).to eq(' <redacted date> ')
|
283
283
|
end
|
284
|
+
|
285
|
+
it 'replaces the date occurences in a string #003' do
|
286
|
+
string = '15 de Oktober 2020'
|
287
|
+
ws = ConfidentialInfoRedactorLite::Date.new(string: string, dow: de_dow, dow_abbr: de_dow_abbr, months: de_months, months_abbr: de_month_abbr)
|
288
|
+
expect(ws.replace).to eq(' <redacted date> ')
|
289
|
+
end
|
284
290
|
end
|
285
291
|
|
286
292
|
context 'Japanese (ja)' do
|