confidential_info_redactor_lite 0.0.22 → 0.0.23

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: 682e05652920a3ab0cf26e3f456f37ede910c268
4
- data.tar.gz: 31d2cc997634e60820697d9d5574300c70e1db6e
3
+ metadata.gz: d31deb97b220f8402e965a8bdba7be18536c9a19
4
+ data.tar.gz: 464e48177514cc1b737f719559c964c064d26716
5
5
  SHA512:
6
- metadata.gz: 5a18daa3439b0aa335231bfc8a0cdcb1500097ad00a291928e397271ff491f7a2a49e25c9e14803cfd3366d750e77cf387a22413fbd0c56a212e1b1eeaf54ba0
7
- data.tar.gz: dd11d3fabbddc375d91069447441952183d5dc443bfac00573066405a81fad8cb396d420af2546c250de48aeb697f74c53752a5433f700796b6f66c272ecd339
6
+ metadata.gz: b6e088701b4056d194f3143a716f365bcb28ab8df6a66e89376562c66362b913c5be51120aa0e6517e0b4ec0aabc034596812f0b8f960f19185cf63d51cfc175
7
+ data.tar.gz: 7b09007bb9e8e356cfff856ebdd1baea66c836e5dc5fa568c15c524ed413cb312227e418ddca6997978d8833e95c0624a2b1e2822e035690ed865cf05a623cc4
@@ -165,7 +165,7 @@ module ConfidentialInfoRedactorLite
165
165
  end
166
166
 
167
167
  def redact_numbers(txt)
168
- txt.gsub(NUMBER_REGEX, " #{number_text} ").gsub(/\s*#{Regexp.escape(number_text)}\s*/, " #{number_text} ").gsub(/\A\s*#{Regexp.escape(number_text)}\s*/, "#{number_text} ").gsub(/#{Regexp.escape(number_text)}\s{1}\.{1}/, "#{number_text}.").gsub(/#{Regexp.escape(number_text)}\s{1}\,{1}/, "#{number_text},").gsub(/#{Regexp.escape(number_text)}\s{1}\){1}/, "#{number_text})").gsub(/\(\s{1}#{Regexp.escape(number_text)}/, "(#{number_text}").gsub(/#{Regexp.escape(number_text)}\s\z/, "#{number_text}")
168
+ txt.gsub(NUMBER_REGEX, " #{number_text} ").gsub(/[0123456789]+/, " #{number_text} ").gsub(/\s*#{Regexp.escape(number_text)}\s*/, " #{number_text} ").gsub(/\A\s*#{Regexp.escape(number_text)}\s*/, "#{number_text} ").gsub(/#{Regexp.escape(number_text)}\s{1}\.{1}/, "#{number_text}.").gsub(/#{Regexp.escape(number_text)}\s{1}\,{1}/, "#{number_text},").gsub(/#{Regexp.escape(number_text)}\s{1}\){1}/, "#{number_text})").gsub(/\(\s{1}#{Regexp.escape(number_text)}/, "(#{number_text}").gsub(/#{Regexp.escape(number_text)}\s\z/, "#{number_text}")
169
169
  end
170
170
 
171
171
  def redact_emails(txt)
@@ -1,3 +1,3 @@
1
1
  module ConfidentialInfoRedactorLite
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
@@ -76,6 +76,11 @@ RSpec.describe ConfidentialInfoRedactorLite::Redactor do
76
76
  text = 'zawiera pliki skompresowane (%2).'
77
77
  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('zawiera pliki skompresowane (<redacted number>).')
78
78
  end
79
+
80
+ it 'redacts numbers from a text #006' do
81
+ text = '2134か24か0'
82
+ 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>")
83
+ end
79
84
  end
80
85
 
81
86
  describe '#numbers_html' do
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.22
4
+ version: 0.0.23
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-24 00:00:00.000000000 Z
11
+ date: 2015-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler