credit_card_sanitizer 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/credit_card_sanitizer.rb +2 -4
  3. metadata +14 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02f8c28ce67104a4f9a5940e8c6d75bab341b39f
4
- data.tar.gz: 0a4b62db35f275a631ea1d693ef4670d4fa120b4
3
+ metadata.gz: 6e9f2955e97cc9bcf999370fbc93ea35da129b84
4
+ data.tar.gz: 0b726e36cadcc45bf31a7eb16ba7e6be5d4d93e6
5
5
  SHA512:
6
- metadata.gz: 39232c703a7dfcd173420a10fda77002a37d8a8d38d3cb1e0a1ce1d43e44972e43ec1487815f5cec5a0e16c8c92caedb423cbc8b03af48d73119d676bb901d81
7
- data.tar.gz: 37b6f130aaf04e5cbc0def0563fdcfdf7214f062987e1d078ba0d447241b0f8f0045bdd340843ab575f35b000656c3de5435f933c63ffc4643e2e21db04de748
6
+ metadata.gz: 4c471ac845a54ea18095dd29f3fe4375313d79dbd8347883825cde5ab30cbaf8b4538341683513461e4cd3d45263754943faa66e0840690229379c377f07cdad
7
+ data.tar.gz: 6a1b7e253c08d4870dd92019ec6b73649d9eeffba93e2fdaf9e6899a6c717bc527b8f32262d29a5a1ab6f5e5a96fa0fefc7f055324bafb9e726de0ca504d73cc
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'luhn_checksum'
4
4
  require 'securerandom'
5
- require 'scrub_rb'
6
5
  require 'tracking_number'
7
6
 
8
7
  class CreditCardSanitizer
@@ -40,11 +39,11 @@ class CreditCardSanitizer
40
39
 
41
40
  VALID_COMPANY_PREFIXES = Regexp.union(*CARD_COMPANIES.values)
42
41
  EXPIRATION_DATE = /\s(?:0?[1-9]|1[0-2])(?:\/|-)(?:\d{4}|\d{2})(?:\s|$)/
43
- LINE_NOISE_CHAR = /[^\w_\n,().\/:;<>]/
42
+ LINE_NOISE_CHAR = /[^\w\n,()&.\/:;<>]/
44
43
  LINE_NOISE = /#{LINE_NOISE_CHAR}{,5}/
45
44
  NONEMPTY_LINE_NOISE = /#{LINE_NOISE_CHAR}{1,5}/
46
45
  SCHEME_OR_PLUS = /((?:&#43;|\+)|(?:[a-zA-Z][\-+.a-zA-Z\d]{,9}):[^\s>]+)/
47
- NUMBERS_WITH_LINE_NOISE = /#{SCHEME_OR_PLUS}?\d(?:#{LINE_NOISE}\d){10,18}/
46
+ NUMBERS_WITH_LINE_NOISE = /#{SCHEME_OR_PLUS}?\d(?:#{LINE_NOISE}\d){10,30}/
48
47
 
49
48
  DEFAULT_OPTIONS = {
50
49
  replacement_token: '▇',
@@ -95,7 +94,6 @@ class CreditCardSanitizer
95
94
  text.scrub!('�')
96
95
 
97
96
  redacted = nil
98
-
99
97
  without_expiration(text) do
100
98
  text.gsub!(NUMBERS_WITH_LINE_NOISE) do |match|
101
99
  next match if $1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credit_card_sanitizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Chapweske
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-08-31 00:00:00.000000000 Z
13
+ date: 2017-02-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: appraisal
@@ -69,47 +69,47 @@ dependencies:
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  - !ruby/object:Gem::Dependency
72
- name: luhn_checksum
72
+ name: byebug
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - "~>"
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
- version: '0.1'
78
- type: :runtime
77
+ version: '0'
78
+ type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - "~>"
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
- version: '0.1'
84
+ version: '0'
85
85
  - !ruby/object:Gem::Dependency
86
- name: tracking_number
86
+ name: luhn_checksum
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: 0.10.2
91
+ version: '0.1'
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: 0.10.2
98
+ version: '0.1'
99
99
  - !ruby/object:Gem::Dependency
100
- name: scrub_rb
100
+ name: tracking_number
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: 1.0.1
105
+ version: 0.10.2
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: 1.0.1
112
+ version: 0.10.2
113
113
  description: Credit card sanitizer
114
114
  email:
115
115
  - ggrossman@zendesk.com