effective_resources 2.25.6 → 2.25.8

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: 281dfe01432d3d514f46f43b7c0d76478b4675827581c2b9867ab14af1f51aae
4
- data.tar.gz: 7edf326e2bd629a49b812e5ee96749e0ad95fb5b81d87d18b14a7452134af78a
3
+ metadata.gz: d8f2a6d3f6a5e7a4990cbada79e6a586cf4ff862e13e671ce7430dc7a0291fb6
4
+ data.tar.gz: 0b179f2534e16cf962c8a1558f6704d2a1019bbf937efe17482c8b891b2ccc7c
5
5
  SHA512:
6
- metadata.gz: 5e0af3a5c4f970d6c637a1429cf252875274a605c92c328fa87e05b9df4366b1924e466ab76e12c8be12f0980ae8dc091de5bc665de34307e6774d9c96bd7fe1
7
- data.tar.gz: 85ea2f2757651bd051e549da3356d79729ec235776ae8eb35f00037f9616cd16ce5b08772a39fef6656f3926b137e4d6a1fdb9650cb45a60082b88cd29fbc07f
6
+ metadata.gz: f229ae0b703c7f5beb10cfdd9eae932e02864a7e1268b06a0a2164b9b13529b9fa149951cb04c2357f06dcc31841d4b655eea31600c47c885deff714c36eb91d
7
+ data.tar.gz: 99d3ffa74df4f289ee984b3438acb6041b2e5aaf20008b1abdc0d2e64e9706e38eb97c320bbc0bafffebb1ae514467a28004b9e963c9a122a3967163fea08242
@@ -64,6 +64,7 @@ module Effective
64
64
  else
65
65
  "<span>#{resource}</span>"
66
66
  end
67
+ end
67
68
 
68
69
  def to_select2(resource)
69
70
  if resource.try(:email).present?
@@ -324,17 +324,7 @@ module EffectiveResourcesHelper
324
324
  end
325
325
 
326
326
  def masked_email(resource)
327
- public_email = resource.try(:public_email)
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.25.6'.freeze
2
+ VERSION = '2.25.8'.freeze
3
3
  end
@@ -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.6
4
+ version: 2.25.8
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-08 00:00:00.000000000 Z
11
+ date: 2024-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails