effective_resources 2.25.7 → 2.25.9
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5e923e218d9738cf726a638f0d850c3b2b86e4177b040bc50b0a8a1665e4ba1
|
4
|
+
data.tar.gz: 4d362460cea6561d38058ec8764e9e98c7e1b9a0899f49244de71a17a0e11942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2770956df98832a7d08471d6182643f3317daf85924d9797f0ac4e1863a26222bf9d4a16730e21a15d364a1fb04d0f88f26833ff198b201e1a2bc9a36bb7b881
|
7
|
+
data.tar.gz: 979ca1c1afc1d8a2645072e3710b5d68436259082f16fb92e8d786953f5f027401fcb07e23afeeba97cc7b66af73d86803de412030341269298377d3224248d5
|
@@ -324,17 +324,7 @@ module EffectiveResourcesHelper
|
|
324
324
|
end
|
325
325
|
|
326
326
|
def masked_email(resource)
|
327
|
-
|
328
|
-
return public_email if public_email.present?
|
329
|
-
|
330
|
-
email = resource.email
|
331
|
-
return email if email.blank?
|
332
|
-
|
333
|
-
local, domain = email.split('@')
|
334
|
-
masked_local = local[0..1] + '*' * (local.length - 2)
|
335
|
-
masked_domain = domain.split('.').first[0..1] + '*' * (domain.split('.').first.length - 2) + '.' + domain.split('.').last
|
336
|
-
|
337
|
-
"#{masked_local}@#{masked_domain}"
|
327
|
+
EffectiveResources.masked_email(resource)
|
338
328
|
end
|
339
329
|
|
340
330
|
end
|
@@ -80,17 +80,19 @@ module Effective
|
|
80
80
|
raise('expected an ActiveSupport::OrderedOptions') unless value.kind_of?(ActiveSupport::OrderedOptions)
|
81
81
|
parse_ordered_options(value)
|
82
82
|
when :date, :datetime
|
83
|
-
|
84
|
-
|
83
|
+
date = Time.zone.parse(value) if value.to_s.include?('T')
|
84
|
+
|
85
|
+
date ||= if (digits = value.to_s.scan(/(\d+)/).flatten).present?
|
86
|
+
if digits.first.length == 4 # 2017-01-10
|
85
87
|
(Time.zone.local(*digits) rescue nil)
|
86
88
|
else # 01/10/2016
|
87
89
|
year = digits.find { |d| d.length == 4 }
|
88
90
|
digits = [year] + (digits - [year])
|
89
91
|
(Time.zone.local(*digits) rescue nil)
|
90
92
|
end
|
91
|
-
|
92
|
-
name.to_s.start_with?('end_') ? date.end_of_day : date
|
93
93
|
end
|
94
|
+
|
95
|
+
date.present? && name.to_s.start_with?('end_') ? date.end_of_day : date
|
94
96
|
when :time
|
95
97
|
if (digits = value.to_s.scan(/(\d+)/).flatten).present?
|
96
98
|
now = Time.zone.now
|
data/lib/effective_resources.rb
CHANGED
@@ -237,4 +237,18 @@ module EffectiveResources
|
|
237
237
|
end
|
238
238
|
end
|
239
239
|
|
240
|
+
def self.masked_email(resource)
|
241
|
+
public_email = resource.try(:public_email)
|
242
|
+
return public_email if public_email.present?
|
243
|
+
|
244
|
+
email = resource.email
|
245
|
+
return email if email.blank?
|
246
|
+
|
247
|
+
local, domain = email.split('@')
|
248
|
+
masked_local = local[0..1] + '*' * (local.length - 2)
|
249
|
+
masked_domain = domain.split('.').first[0..1] + '*' * (domain.split('.').first.length - 2) + '.' + domain.split('.').last
|
250
|
+
|
251
|
+
"#{masked_local}@#{masked_domain}"
|
252
|
+
end
|
253
|
+
|
240
254
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.25.
|
4
|
+
version: 2.25.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|