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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d31deb97b220f8402e965a8bdba7be18536c9a19
|
4
|
+
data.tar.gz: 464e48177514cc1b737f719559c964c064d26716
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
@@ -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.
|
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-
|
11
|
+
date: 2015-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|