send_grid_mailer 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6d6d84b5829afa21ab215e02bece2ccaba7d7ac
4
- data.tar.gz: cae30204663988eda53caeebe064852b2faf96c3
3
+ metadata.gz: 9fc4e94f60e1028da201de83ef0e353105a1135b
4
+ data.tar.gz: a6e7a11542b6160bbdf77b3313bb09fca37a4d34
5
5
  SHA512:
6
- metadata.gz: 6ab1e75330adca90bcb39ef0084c0f930ee8b3974e7462da0d735f7efc441cd097514eb7db02e95b9b020ac20c7a828316db9a1e2587ce90a097073fc44152a0
7
- data.tar.gz: 0d7c96e6ccad96a206b1693861a5df4e1ed8ced8a4e7f636551a6c8a48111f55bf1169d0abd4af8302e59fd73a8933313c78410aa64227084940580695d52a0f
6
+ metadata.gz: 18c31da2785607f422c4bacb5a4454a0852f32865f42aa1a2826f93e25d27ecf003dea9a547dceac7e3a8d44eeabbaaf45009dbdbdb2b03d7d8de19fc340f6fd
7
+ data.tar.gz: 22ebd4fc60adc44d42a4be3fa0fa8716248f63cc69aacb3d506a5787553145023f41234af415ec4d7c4b15bd6fc0f63fa05a2ab4160f58be3e1e5bc54b4ca234
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ spec/dummy/log/*.log
7
7
  spec/dummy/tmp/
8
8
  spec/dummy/.sass-cache
9
9
  coverage/
10
+ Gemfile.lock
@@ -2,6 +2,12 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ### v0.5.0
6
+
7
+ ##### Changed
8
+
9
+ * Support sender with standard email string "email> name", #3, thanks @agustinf
10
+
5
11
  ### v0.4.0
6
12
 
7
13
  ##### Changed
@@ -32,7 +32,14 @@ module SendGridMailer
32
32
 
33
33
  def set_sender(email)
34
34
  return unless email
35
- mail.from = SendGrid::Email.new(email: email)
35
+ matched_format = email.match(/<(.+)>/)
36
+ if matched_format
37
+ address = matched_format[1]
38
+ name = email.match(/\"?([^<^\"]*)\"?\s?/)[1].strip
39
+ mail.from = SendGrid::Email.new(email: address, name: name)
40
+ else
41
+ mail.from = SendGrid::Email.new(email: email)
42
+ end
36
43
  end
37
44
 
38
45
  def set_recipients(mode, *emails)
@@ -1,3 +1,3 @@
1
1
  module SendGridMailer
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -37,6 +37,13 @@ describe SendGridMailer::Definition do
37
37
  end
38
38
  end
39
39
 
40
+ describe "#set_sender" do
41
+ it "adds sender with format to mail object" do
42
+ subject.set_sender("Sender Name <sender@platan.us>")
43
+ expect(mail.from).to eq("email" => "sender@platan.us", "name" => "Sender Name")
44
+ end
45
+ end
46
+
40
47
  describe "#set_recipients" do
41
48
  let(:m1) { "leandro@platan.us" }
42
49
  let(:m2) { "ldlsegovia@gmail.com" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: send_grid_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-04-19 00:00:00.000000000 Z
12
+ date: 2017-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -160,7 +160,6 @@ files:
160
160
  - ".travis.yml"
161
161
  - CHANGELOG.md
162
162
  - Gemfile
163
- - Gemfile.lock
164
163
  - Guardfile
165
164
  - LICENSE.txt
166
165
  - README.md
@@ -1,206 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- send_grid_mailer (0.4.0)
5
- rails (>= 4.2.0)
6
- sendgrid-ruby (~> 4.0, >= 4.0.4)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionmailer (4.2.7.1)
12
- actionpack (= 4.2.7.1)
13
- actionview (= 4.2.7.1)
14
- activejob (= 4.2.7.1)
15
- mail (~> 2.5, >= 2.5.4)
16
- rails-dom-testing (~> 1.0, >= 1.0.5)
17
- actionpack (4.2.7.1)
18
- actionview (= 4.2.7.1)
19
- activesupport (= 4.2.7.1)
20
- rack (~> 1.6)
21
- rack-test (~> 0.6.2)
22
- rails-dom-testing (~> 1.0, >= 1.0.5)
23
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
- actionview (4.2.7.1)
25
- activesupport (= 4.2.7.1)
26
- builder (~> 3.1)
27
- erubis (~> 2.7.0)
28
- rails-dom-testing (~> 1.0, >= 1.0.5)
29
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
- activejob (4.2.7.1)
31
- activesupport (= 4.2.7.1)
32
- globalid (>= 0.3.0)
33
- activemodel (4.2.7.1)
34
- activesupport (= 4.2.7.1)
35
- builder (~> 3.1)
36
- activerecord (4.2.7.1)
37
- activemodel (= 4.2.7.1)
38
- activesupport (= 4.2.7.1)
39
- arel (~> 6.0)
40
- activesupport (4.2.7.1)
41
- i18n (~> 0.7)
42
- json (~> 1.7, >= 1.7.7)
43
- minitest (~> 5.1)
44
- thread_safe (~> 0.3, >= 0.3.4)
45
- tzinfo (~> 1.1)
46
- arel (6.0.4)
47
- builder (3.2.2)
48
- coderay (1.1.1)
49
- concurrent-ruby (1.0.5)
50
- coveralls (0.8.19)
51
- json (>= 1.8, < 3)
52
- simplecov (~> 0.12.0)
53
- term-ansicolor (~> 1.3)
54
- thor (~> 0.19.1)
55
- tins (~> 1.6)
56
- diff-lcs (1.2.5)
57
- docile (1.1.5)
58
- erubis (2.7.0)
59
- factory_girl (4.5.0)
60
- activesupport (>= 3.0.0)
61
- factory_girl_rails (4.6.0)
62
- factory_girl (~> 4.5.0)
63
- railties (>= 3.0.0)
64
- ffi (1.9.14)
65
- formatador (0.2.5)
66
- globalid (0.4.0)
67
- activesupport (>= 4.2.0)
68
- guard (2.14.0)
69
- formatador (>= 0.2.4)
70
- listen (>= 2.7, < 4.0)
71
- lumberjack (~> 1.0)
72
- nenv (~> 0.1)
73
- notiffany (~> 0.0)
74
- pry (>= 0.9.12)
75
- shellany (~> 0.0)
76
- thor (>= 0.18.1)
77
- guard-compat (1.2.1)
78
- guard-rspec (4.7.3)
79
- guard (~> 2.1)
80
- guard-compat (~> 1.1)
81
- rspec (>= 2.99.0, < 4.0)
82
- i18n (0.7.0)
83
- json (1.8.3)
84
- listen (3.1.5)
85
- rb-fsevent (~> 0.9, >= 0.9.4)
86
- rb-inotify (~> 0.9, >= 0.9.7)
87
- ruby_dep (~> 1.2)
88
- loofah (2.0.3)
89
- nokogiri (>= 1.5.9)
90
- lumberjack (1.0.10)
91
- mail (2.6.4)
92
- mime-types (>= 1.16, < 4)
93
- method_source (0.8.2)
94
- mime-types (3.1)
95
- mime-types-data (~> 3.2015)
96
- mime-types-data (3.2016.0521)
97
- mini_portile2 (2.1.0)
98
- minitest (5.9.0)
99
- nenv (0.3.0)
100
- nokogiri (1.6.8)
101
- mini_portile2 (~> 2.1.0)
102
- pkg-config (~> 1.1.7)
103
- notiffany (0.1.1)
104
- nenv (~> 0.1)
105
- shellany (~> 0.0)
106
- pkg-config (1.1.7)
107
- pry (0.10.4)
108
- coderay (~> 1.1.0)
109
- method_source (~> 0.8.1)
110
- slop (~> 3.4)
111
- pry-rails (0.3.4)
112
- pry (>= 0.9.10)
113
- rack (1.6.4)
114
- rack-test (0.6.3)
115
- rack (>= 1.0)
116
- rails (4.2.7.1)
117
- actionmailer (= 4.2.7.1)
118
- actionpack (= 4.2.7.1)
119
- actionview (= 4.2.7.1)
120
- activejob (= 4.2.7.1)
121
- activemodel (= 4.2.7.1)
122
- activerecord (= 4.2.7.1)
123
- activesupport (= 4.2.7.1)
124
- bundler (>= 1.3.0, < 2.0)
125
- railties (= 4.2.7.1)
126
- sprockets-rails
127
- rails-deprecated_sanitizer (1.0.3)
128
- activesupport (>= 4.2.0.alpha)
129
- rails-dom-testing (1.0.7)
130
- activesupport (>= 4.2.0.beta, < 5.0)
131
- nokogiri (~> 1.6.0)
132
- rails-deprecated_sanitizer (>= 1.0.1)
133
- rails-html-sanitizer (1.0.3)
134
- loofah (~> 2.0)
135
- railties (4.2.7.1)
136
- actionpack (= 4.2.7.1)
137
- activesupport (= 4.2.7.1)
138
- rake (>= 0.8.7)
139
- thor (>= 0.18.1, < 2.0)
140
- rake (11.3.0)
141
- rb-fsevent (0.9.7)
142
- rb-inotify (0.9.7)
143
- ffi (>= 0.5.0)
144
- rspec (3.4.0)
145
- rspec-core (~> 3.4.0)
146
- rspec-expectations (~> 3.4.0)
147
- rspec-mocks (~> 3.4.0)
148
- rspec-core (3.4.4)
149
- rspec-support (~> 3.4.0)
150
- rspec-expectations (3.4.0)
151
- diff-lcs (>= 1.2.0, < 2.0)
152
- rspec-support (~> 3.4.0)
153
- rspec-mocks (3.4.1)
154
- diff-lcs (>= 1.2.0, < 2.0)
155
- rspec-support (~> 3.4.0)
156
- rspec-rails (3.4.2)
157
- actionpack (>= 3.0, < 4.3)
158
- activesupport (>= 3.0, < 4.3)
159
- railties (>= 3.0, < 4.3)
160
- rspec-core (~> 3.4.0)
161
- rspec-expectations (~> 3.4.0)
162
- rspec-mocks (~> 3.4.0)
163
- rspec-support (~> 3.4.0)
164
- rspec-support (3.4.1)
165
- ruby_dep (1.4.0)
166
- ruby_http_client (3.0.2)
167
- sendgrid-ruby (4.0.8)
168
- ruby_http_client (~> 3.0.1)
169
- shellany (0.0.1)
170
- simplecov (0.12.0)
171
- docile (~> 1.1.0)
172
- json (>= 1.8, < 3)
173
- simplecov-html (~> 0.10.0)
174
- simplecov-html (0.10.0)
175
- slop (3.6.0)
176
- sprockets (3.7.1)
177
- concurrent-ruby (~> 1.0)
178
- rack (> 1, < 3)
179
- sprockets-rails (3.2.0)
180
- actionpack (>= 4.0)
181
- activesupport (>= 4.0)
182
- sprockets (>= 3.0.0)
183
- sqlite3 (1.3.11)
184
- term-ansicolor (1.4.0)
185
- tins (~> 1.0)
186
- thor (0.19.1)
187
- thread_safe (0.3.5)
188
- tins (1.13.2)
189
- tzinfo (1.2.2)
190
- thread_safe (~> 0.1)
191
-
192
- PLATFORMS
193
- ruby
194
-
195
- DEPENDENCIES
196
- coveralls
197
- factory_girl_rails (~> 4.6.0)
198
- guard-rspec (~> 4.7)
199
- pry
200
- pry-rails
201
- rspec-rails (~> 3.4.0)
202
- send_grid_mailer!
203
- sqlite3
204
-
205
- BUNDLED WITH
206
- 1.14.6