safe_email_name 0.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 +7 -0
  2. data/lib/safe_email_name.rb +13 -0
  3. metadata +46 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4e954d8f4e2464865b184b457bbb018a6f2bbb51
4
+ data.tar.gz: 25f5dae5153a06116a805a8a4ec1ba45708fd596
5
+ SHA512:
6
+ metadata.gz: 84a8a609a53412b69cac9caf1ee63083d3c00bc1c15c3d42ee5924264e4e15f790dba36deb0fed80c2744b8b26022ef67df55515a886701ca2d910ea50561ec5
7
+ data.tar.gz: 7c85a6ba3c75ada84f2dc0d959f0ab97cbbec1cd4016dff3bb3ed2077a8af82676cd8c55df6896ac4e5e53604bfad703649716c97303f090ddcb4dda29450495
@@ -0,0 +1,13 @@
1
+ module SafeEmailName
2
+ def safe_email_name(name, email)
3
+ escaped_chars = /"<>/
4
+ email = email.gsub(escaped_chars, '')
5
+ name = name.gsub(escaped_chars, '')
6
+ "#{name} <#{email}>"
7
+ end
8
+
9
+ # Make method available as a class method as well.
10
+ def self.included(base)
11
+ base.extend(SafeEmailName)
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: safe_email_name
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sunny Ripert
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-25 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Escape the name in To and From fields in emails
14
+ email:
15
+ - sunny@kisskissbankbank.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/safe_email_name.rb
21
+ homepage: https://github.com/KissKissBankBank/safe_email_name
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.4.5
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Escape To and From fields in emails
45
+ test_files: []
46
+ has_rdoc: