confidential_info_redactor_lite 1.0.3 → 1.0.4
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: 03eb24107d3e6999e966dd7a6c876a2ce01d644a
|
4
|
+
data.tar.gz: 1156cc1c07efb71377d45bf15e34d49890a297a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d4fa30390a552389ec6f9b43496475b4beefc0faeaaa029fd097e516125001c80305247f42eec4734dd68dd18ce161d18042953b6cc2ad58e0228747ed50be6
|
7
|
+
data.tar.gz: 7fae890897742922cb278b1873e993a25144e4e5273dd91cd528e2f19f65d058eda2d2efe66204278a83274205026015595fe9fc8ceb38c104ae80176fdd8312
|
@@ -5,7 +5,7 @@ module ConfidentialInfoRedactorLite
|
|
5
5
|
# This class redacts various tokens from a text
|
6
6
|
class Redactor
|
7
7
|
# Rubular: http://rubular.com/r/OI2wQZ0KSl
|
8
|
-
NUMBER_REGEX = /(?<=\A|\A\()[^(]?\d+((,|\.)*\d)*(\D?\s|\s|\.?\s
|
8
|
+
NUMBER_REGEX = /(?<=\A|\A\()[^(]?\d+((,|\.)*\d)*(\D?\s|\s|\.?\s|\.$|$)|(?<=\s|\s\(|\s'|\s‘)[^('‘]?\d+((,|\.)*\d)*(?=(\D?\s|\s|\.?\s|\.$))|(?<=\s)\d+(nd|th|st)|(?<=\s)\d+\/\d+\"*(?=\s)|(?<=\()\S{1}\d+(?=\))|(?<=\s{1})\S{1}\d+\z|^\d+$/
|
9
9
|
# Rubular: http://rubular.com/r/mxcj2G0Jfa
|
10
10
|
EMAIL_REGEX = /(?<=\A|\s|\()[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+(?=\z|\s|\.|\))/i
|
11
11
|
|
@@ -113,6 +113,11 @@ RSpec.describe ConfidentialInfoRedactorLite::Redactor do
|
|
113
113
|
text = "Test ‘0’ hello."
|
114
114
|
expect(described_class.new(language: 'en', dow: en_dow, dow_abbr: en_dow_abbr, months: en_months, months_abbr: en_month_abbr).numbers_html(text)[1]).to eq(["0"])
|
115
115
|
end
|
116
|
+
|
117
|
+
it 'redacts numbers from a text #010' do
|
118
|
+
text = "1.4,5.3,7.3"
|
119
|
+
expect(described_class.new(language: 'en', dow: en_dow, dow_abbr: en_dow_abbr, months: en_months, months_abbr: en_month_abbr).numbers_html(text)[1]).to eq(["1.4,5.3,7.3"])
|
120
|
+
end
|
116
121
|
end
|
117
122
|
|
118
123
|
describe '#numbers_html' do
|