web47core 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/core_helper.rb +6 -5
- data/lib/web47core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66de41059addc2feb9a356910262228c3023e61b3860080f55e1b7a66b0f3b8c
|
4
|
+
data.tar.gz: 40768029411501eb25cf379bc9d42fb3a1ab0124103e09a29df09cf3816afbb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 211c0e7e8ea7bd957ce8d4212d6ea72d10362f3d298d718c6d68d897a3dc2da76a0dddf4265f23dcf6881ab8b079a457666d6786f0044fb32565e5082212b78a
|
7
|
+
data.tar.gz: 7699c4fde4221b0beca0819239477cbd6e086c2f0f5a92e40fe98079cc96ba419bd0d94bede45d10b14483de2b8e51dbc89209567f5974070ddd786e9e05acfd
|
data/app/helpers/core_helper.rb
CHANGED
@@ -60,15 +60,16 @@ module CoreHelper
|
|
60
60
|
# 3. Length 5-10 only show the first and last character
|
61
61
|
# 4. Otherwise show the first and last three characters
|
62
62
|
def mask_value(value, default: '************')
|
63
|
-
return default if value.blank?
|
63
|
+
return default if value.blank? || !value.respond_to?(:to_s)
|
64
64
|
|
65
|
-
|
65
|
+
string_value = value.to_s
|
66
|
+
case string_value.length
|
66
67
|
when 1..4
|
67
|
-
"#{
|
68
|
+
"#{string_value.first}***********"
|
68
69
|
when 5..10
|
69
|
-
"#{
|
70
|
+
"#{string_value.first}**********#{string_value.last}"
|
70
71
|
else
|
71
|
-
"#{
|
72
|
+
"#{string_value[0..2]}**********#{string_value[-3..-1]}"
|
72
73
|
end
|
73
74
|
end
|
74
75
|
|
data/lib/web47core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web47core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Schroeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|