confidential_info_redactor_lite 0.0.10 → 0.0.11

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: b9a493d85c2cd235866ab329d987ebc634742127
4
- data.tar.gz: a9fee602079d81f7d9e0970d59cca14197a8b31d
3
+ metadata.gz: da81c29742b6a0de3ff4fda8642708463d2e5ff3
4
+ data.tar.gz: 08df7243749f2ddf249b7035465fae927becf582
5
5
  SHA512:
6
- metadata.gz: b77ba5ea584cb31bff9084d108eae3c0f2630a4bd9fe4a99603f12240fe267a14da5ee4be22fbb38bdfa5bba29054eca64cbb4a1b7755a0c926b2a43edec42b1
7
- data.tar.gz: dc783fce3502f7e62f5ddabbca2e9c0901d9fbb5b88e2ec003ceb1c8dd6647cef766d0b876ad1bb6584570b98f73e8a4e652203adc042e20c4cb96ed83886e32
6
+ metadata.gz: 6ec8c4ad9f55ebe4755c8a7024a8b5795be487dbdaaf658f3f3797a9242195fc149b2133085eb4c5f3dde7d08cd051571296b17b0565682e3932d13702f9b842
7
+ data.tar.gz: 3bcda0bdef7a7f80484ef462301ad715568f683fc50241fa59be725605cd717f91161dbba713d09c13fb7e650ba5f968218e52cf8b2db2b5969cecaf61d1df73
@@ -98,7 +98,7 @@ module ConfidentialInfoRedactorLite
98
98
  original_sentence_array = txt.split(' ')
99
99
  redacted_sentence_array = redacted_text.split(' ')
100
100
  diff = original_sentence_array - redacted_sentence_array
101
- final_number_tokens = diff.map { |token| token[-1].eql?('.') ? token[0...-1] : token }
101
+ final_number_tokens = diff.map { |token| token[-1].eql?('.') ? token[0...-1] : token }.map { |token| token[-1].eql?(')') ? token[0...-1] : token }.map { |token| token[0].eql?('(') ? token[1..token.length] : token }
102
102
  [redacted_text.gsub(/(?<=[^\>])#{Regexp.escape(number_text)}/, "<span class='confidentialNumber'>#{number_text}</span>"), final_number_tokens]
103
103
  end
104
104
 
@@ -1,3 +1,3 @@
1
1
  module ConfidentialInfoRedactorLite
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -70,8 +70,8 @@ RSpec.describe ConfidentialInfoRedactorLite::Redactor do
70
70
 
71
71
  describe '#numbers_html' do
72
72
  it 'surrounds the redacted numbers in spans and return the redacted numbers from a text #001' do
73
- text = 'It was his 1st time, not yet his 10th, not even his 2nd. The wood was 3/4" thick. It cost $200,000.'
74
- expect(described_class.new(text: text, language: 'en', dow: en_dow, dow_abbr: en_dow_abbr, months: en_months, months_abbr: en_month_abbr, number_text: "*****").numbers_html).to eq(["It was his <span class='confidentialNumber'>*****</span> time, not yet his <span class='confidentialNumber'>*****</span>, not even his <span class='confidentialNumber'>*****</span>. The wood was <span class='confidentialNumber'>*****</span> thick. It cost <span class='confidentialNumber'>*****</span>.", ["1st", "10th,", "2nd", "3/4\"", "$200,000"]])
73
+ text = 'It was his 1st) time, not yet his 10th, not even his 2nd. The wood was 3/4" thick. It cost $200,000.'
74
+ expect(described_class.new(text: text, language: 'en', dow: en_dow, dow_abbr: en_dow_abbr, months: en_months, months_abbr: en_month_abbr, number_text: "*****").numbers_html).to eq(["It was his <span class='confidentialNumber'>*****</span>) time, not yet his <span class='confidentialNumber'>*****</span>, not even his <span class='confidentialNumber'>*****</span>. The wood was <span class='confidentialNumber'>*****</span> thick. It cost <span class='confidentialNumber'>*****</span>.", ["1st", "10th,", "2nd", "3/4\"", "$200,000"]])
75
75
  end
76
76
  end
77
77
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confidential_info_redactor_lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin S. Dias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler