confidential_info_redactor_lite 0.0.27 → 0.0.28

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: 0ceeb1140b59f594ab6600ed27b362721f7626cb
4
- data.tar.gz: b8daee381620d1fdd3e3883c1ea9d0702ceb2c6f
3
+ metadata.gz: 30063f5ba3364d7c60543ff81a35a7f97f89429f
4
+ data.tar.gz: fe0ba36ba83fc098378b137e868e37dd5d07f09a
5
5
  SHA512:
6
- metadata.gz: 7c8dbb77b0779043b8fcdc501730624f7827d0e54d1a81cdaaf33e677ef9b2242854c323b0eeb535eb97096cb0e97a3a225ab2642058de2f24c36ac473c983dc
7
- data.tar.gz: 6b426392130a87db3b65a320a74f77911f2db7491e80f7becf793d216f9a5d538ad76a41c79980e389285d10fa74ee383ba5fb9f381a4f14f5cc29b80a3f5411
6
+ metadata.gz: 2ae5ec4388489e91256a0f81b8d7eb78677abd5d9f1501ef61c05e47d08f62b7d5251fa463d6603e39d735eb54a95b3cce9bff492d17b8ce75432cc6f31fcfec
7
+ data.tar.gz: c11270f613053d7418389a03f84f5d23649f5b513f7fd2a6069d73eebcf3267991564701cee4570616f34df812dd0a59bcee57e9b6950c495effe170099a44ca
@@ -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\()[^(]?\d+((,|\.)*\d)*(?=(\D?\s|\s|\.?\s|\.$))|(?<=\s)\d+(nd|th|st)|(?<=\s)\d+\/\d+\"*(?=\s)|(?<=\()\S{1}\d+(?=\))|(?<=\s{1})\S{1}\d+\z/
8
+ NUMBER_REGEX = /(?<=\A|\A\()[^(]?\d+((,|\.)*\d)*(\D?\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 = "0.0.27"
2
+ VERSION = "0.0.28"
3
3
  end
@@ -86,6 +86,11 @@ RSpec.describe ConfidentialInfoRedactorLite::Redactor do
86
86
  text = '2134か24か0'
87
87
  expect(described_class.new(text: text, language: 'en', dow: en_dow, dow_abbr: en_dow_abbr, months: en_months, months_abbr: en_month_abbr).numbers).to eq("<redacted number> か <redacted number> か <redacted number>")
88
88
  end
89
+
90
+ it 'redacts numbers from a text #007' do
91
+ text = '100'
92
+ expect(described_class.new(text: text, language: 'en', dow: en_dow, dow_abbr: en_dow_abbr, months: en_months, months_abbr: en_month_abbr).numbers).to eq('<redacted number>')
93
+ end
89
94
  end
90
95
 
91
96
  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: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin S. Dias