credit_card_sanitizer 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/credit_card_sanitizer.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed76d9a9522df05c6dd170d26ea92106d17a57f3
|
4
|
+
data.tar.gz: 2d674bd758d3de26a702d7934fecc385c3cf10eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c4c88de4bc7357bb5897ca7f0eb18a472951fd62d63623ca0a37d28b859f3d4891c727cbf44e73920f8bae87f2abca5760532a1ee53f4b4cf89beb9717aa14c
|
7
|
+
data.tar.gz: b55b8fcdf570998f1c4663d435e260b31962e3522fbf97e1b4230c2cef6809e42767de7657aa44390138586b8c122f9080cb360a20600c5971af93711d412cb5
|
@@ -203,7 +203,10 @@ class CreditCardSanitizer
|
|
203
203
|
|
204
204
|
def without_expiration(text)
|
205
205
|
expiration_date_boundary = SecureRandom.hex.tr('0123456789', 'ABCDEFGHIJ')
|
206
|
-
text.gsub!(EXPIRATION_DATE)
|
206
|
+
text.gsub!(EXPIRATION_DATE) do |expiration_date|
|
207
|
+
match = expiration_date.match(/(?<whitespace>\s*)(?<rest>.*)/)
|
208
|
+
"#{match[:whitespace]}#{expiration_date_boundary}#{match[:rest]}#{expiration_date_boundary}"
|
209
|
+
end
|
207
210
|
yield
|
208
211
|
text.gsub!(expiration_date_boundary, '')
|
209
212
|
end
|
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.
|
4
|
+
version: 0.6.7
|
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: 2018-
|
13
|
+
date: 2018-02-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: luhn_checksum
|