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: 39a1611275052f427c8e1c916cb368b0a7337347
4
- data.tar.gz: 528d58ac47b37eb1be8b76f5de0b5ae8518ddb72
3
+ metadata.gz: 03eb24107d3e6999e966dd7a6c876a2ce01d644a
4
+ data.tar.gz: 1156cc1c07efb71377d45bf15e34d49890a297a7
5
5
  SHA512:
6
- metadata.gz: 39537bfadcce276750a5e3e1c53a275c125ddd457672063e880832e9e13138054723315bbc6a7d4ae041268009acf27ca1e54168f9b8d384ca31ddba4f34725a
7
- data.tar.gz: b18afda080a5f8cc75235d202897576f2e76232b3d0c8903f08063e6aaff59c4149ecb7c62ade7944ef4eeff805c271d5c3bed8fe2f57c907edbae053e409a71
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|\.$)|(?<=\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+$/
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
 
@@ -1,3 +1,3 @@
1
1
  module ConfidentialInfoRedactorLite
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
@@ -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
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: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin S. Dias