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: a7d80063ebb28414556f61547b421f497e5be218
4
- data.tar.gz: 41c3cd11ad1f756ad649911b3d8be1b3b298e2a7
3
+ metadata.gz: e4392706f3a5e307a5453009fadcf4010a7162da
4
+ data.tar.gz: 107759c2fd4bbe553f6389bb4c419698c0513285
5
5
  SHA512:
6
- metadata.gz: 5f4b8ef9aa7fdd86687cfde695204b115951ec4435ad1be6794ed85b036d09aea9321821e9149288d4e229d2a3944a810a247a5b0ea7520ae3a25076627fdca6
7
- data.tar.gz: 6b85b88e0cd05997a80e6fb0c53a1febf183f839734efe6392a82e1d90a91fced4582d7e0c2ce3197b4cf3332abf37cb1c0a1106ea6ccaf8ab817be9399e5254
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> ')
@@ -1,3 +1,3 @@
1
1
  module ConfidentialInfoRedactorLite
2
- VERSION = "0.0.30"
2
+ VERSION = "0.0.31"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confidential_info_redactor_lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.30
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin S. Dias