safe_email_name 1.0.0 → 1.0.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/safe_email_name.rb +2 -1
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8449421bd0e8953ac466e5d995bfc686a2d91633
4
- data.tar.gz: 76e240b38be65f76a9decc88ca078919efb24a98
3
+ metadata.gz: 3e2cad3fb69aa0faa761be3e2bb610fd51cf1b68
4
+ data.tar.gz: 5668c8ba25a1880e1908c2db4b722f61ab674cfc
5
5
  SHA512:
6
- metadata.gz: 2874582d7000cda7fe59b68f4d444a95e5d9cea56b743a825370a2ac58de32baffe79184f557ca327efd12334e598db081bc10457b8c286af999fea1c37c79ad
7
- data.tar.gz: 19bbebb2b64e0ab8ee497a8be500f084c6dc26d54403feefce9cd8429d3d10e845de641b48230f81467c8b3042399497487f554e3d0c85d48b33b3bac177561a
6
+ metadata.gz: 1f7f1e2d4bd457cb943e352a2af11c434062ea68f94d73de4d36742f9f130103c80a02b057a0456b022007dd13ee5762511387c180e4b525963587921b5ec4a1
7
+ data.tar.gz: 8e7b7fd88ec816bca11f1387c6fc67f9b38c00f807f9279ac3328d5472cbda071b5682b1570cd728e7fcadb5aae1eec1b1e4d93267852d2a4aafb9bbbc63e289
@@ -5,8 +5,9 @@ require 'active_support/core_ext/string/filters' # squish
5
5
  module SafeEmailName
6
6
  def safe_email_name(name, email)
7
7
  escaped_chars = /["<>]/
8
+
8
9
  email = email.gsub(escaped_chars, '')
9
- name = name.gsub(escaped_chars, '').squish
10
+ name = (name || "").gsub(escaped_chars, '').squish
10
11
  if name.blank?
11
12
  email
12
13
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe_email_name
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sunny Ripert
@@ -14,28 +14,28 @@ dependencies:
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Escape the name in To and From fields in emails