confidential_info_redactor 0.0.5 → 0.0.6

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: aa103ea97296b63392c2927acf0f4c4b79efb681
4
- data.tar.gz: 06cd44370c0f8865169c22ce93a9e3cf54ad1be7
3
+ metadata.gz: 31951b79282316f6c8b8057a54d5264fa1f2f1ca
4
+ data.tar.gz: 3773d4657c9c8605f337dd96abc22c491a72249e
5
5
  SHA512:
6
- metadata.gz: e85f58426c5799bbd33f6d3dc832939dd416778befcd9c9dc3f8a3418a17c45849e101c74253ef4488b1a70a0852feb873c787c635203f0b35bfecf6dfe8a5f0
7
- data.tar.gz: 01cb809f3946face5ddde576b456764f0fb565bfa549423d17470f056907f8cfb35dd2f5828b802654f0e9515fb88d671235b5c76a501ccc143f4dcb59de2955
6
+ metadata.gz: 24a9b492845cd7d2ebd1f6eb7e2aff4452f9f77fe6140f036e7ea3c803ef0f4c7ab3f0c8d871542afb2d2bb6e8f061f0f903f5445acdc555ebe93f729e856631
7
+ data.tar.gz: 9e282995ade4f1e7a8b8605c35278df5b4abb0625ed84dcafb17404336ee5ef57549979f071bc506117ef558cbb20197fa83961476d1135a5ad126453e45fc6b
@@ -6,8 +6,8 @@ module ConfidentialInfoRedactor
6
6
  class Redactor
7
7
  # Rubular: http://rubular.com/r/LRRPtDgJOe
8
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)/
9
- EMAIL_REGEX = /(?<=\A|\s)[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+(?=\z|\s|\.)/i
10
-
9
+ # Rubular: http://rubular.com/r/mxcj2G0Jfa
10
+ EMAIL_REGEX = /(?<=\A|\s|\()[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+(?=\z|\s|\.|\))/i
11
11
 
12
12
  attr_reader :text, :language, :number_text, :date_text, :token_text, :tokens, :ignore_emails, :ignore_dates, :ignore_numbers, :ignore_hyperlinks
13
13
  def initialize(text:, **args)
@@ -1,3 +1,3 @@
1
1
  module ConfidentialInfoRedactor
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -45,6 +45,11 @@ RSpec.describe ConfidentialInfoRedactor::Redactor do
45
45
  text = 'His email is john@gmail.com or you can try k.light@tuv.eu.us.'
46
46
  expect(described_class.new(text: text, language: 'en').emails).to eq('His email is <redacted> or you can try <redacted>.')
47
47
  end
48
+
49
+ it 'redacts email addresses from a text #002' do
50
+ text = 'His email is (john@gmail.com) or you can try (k.light@tuv.eu.us).'
51
+ expect(described_class.new(text: text, language: 'en').emails).to eq('His email is (<redacted>) or you can try (<redacted>).')
52
+ end
48
53
  end
49
54
 
50
55
  describe '#hyperlinks' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confidential_info_redactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
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-16 00:00:00.000000000 Z
11
+ date: 2015-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler