multi_mail 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/.travis.yml +10 -0
- data/README.md +283 -59
- data/Rakefile +38 -19
- data/lib/multi_mail/cloudmailin/receiver.rb +3 -13
- data/lib/multi_mail/mailgun/message.rb +67 -0
- data/lib/multi_mail/mailgun/receiver.rb +20 -13
- data/lib/multi_mail/mailgun/sender.rb +79 -2
- data/lib/multi_mail/mandrill/message.rb +74 -0
- data/lib/multi_mail/mandrill/receiver.rb +36 -16
- data/lib/multi_mail/mandrill/sender.rb +77 -2
- data/lib/multi_mail/message/base.rb +40 -0
- data/lib/multi_mail/postmark/receiver.rb +1 -1
- data/lib/multi_mail/postmark/sender.rb +35 -5
- data/lib/multi_mail/receiver/base.rb +31 -2
- data/lib/multi_mail/receiver.rb +1 -4
- data/lib/multi_mail/sender/base.rb +23 -1
- data/lib/multi_mail/sendgrid/message.rb +74 -0
- data/lib/multi_mail/sendgrid/receiver.rb +72 -23
- data/lib/multi_mail/sendgrid/sender.rb +63 -2
- data/lib/multi_mail/service.rb +48 -56
- data/lib/multi_mail/simple/receiver.rb +4 -4
- data/lib/multi_mail/version.rb +1 -1
- data/lib/multi_mail.rb +16 -1
- data/multi_mail.gemspec +4 -1
- data/spec/fixtures/empty.gif +0 -0
- data/spec/fixtures/mailgun/raw/invalid.txt +13 -0
- data/spec/fixtures/mailgun/raw/missing.txt +13 -0
- data/spec/fixtures/mailgun/raw/spam.txt +13 -0
- data/spec/fixtures/mailgun/raw/valid.txt +13 -0
- data/spec/fixtures/mandrill/invalid.txt +15 -0
- data/spec/fixtures/mandrill/missing.txt +14 -0
- data/spec/fixtures/mandrill/multiple.txt +15 -0
- data/spec/fixtures/mandrill/valid.txt +10 -5
- data/spec/fixtures/postmark/valid.txt +13 -13
- data/spec/fixtures/sendgrid/encoding.txt +90 -0
- data/spec/fixtures/sendgrid/spam.txt +94 -0
- data/spec/fixtures/sendgrid/valid.txt +136 -0
- data/spec/mailgun/message_spec.rb +251 -0
- data/spec/mailgun/receiver_spec.rb +35 -20
- data/spec/mailgun/sender_spec.rb +175 -0
- data/spec/mandrill/message_spec.rb +305 -0
- data/spec/mandrill/receiver_spec.rb +90 -46
- data/spec/mandrill/sender_spec.rb +138 -0
- data/spec/message/base_spec.rb +81 -0
- data/spec/postmark/receiver_spec.rb +4 -4
- data/spec/postmark/sender_spec.rb +118 -0
- data/spec/receiver/base_spec.rb +16 -9
- data/spec/sender/base_spec.rb +24 -10
- data/spec/sendgrid/message_spec.rb +265 -0
- data/spec/sendgrid/receiver_spec.rb +77 -0
- data/spec/sendgrid/sender_spec.rb +140 -0
- data/spec/service_spec.rb +18 -1
- data/spec/simple/receiver_spec.rb +1 -1
- data/spec/spec_helper.rb +46 -4
- metadata +226 -143
- data/lib/multi_mail/sender.rb +0 -46
- data/lib/multi_mail/simple/sender.rb +0 -14
- data/spec/sender_spec.rb +0 -13
- data/spec/simple/sender_spec.rb +0 -0
metadata
CHANGED
@@ -1,183 +1,230 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi_mail
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Open North
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2013-07-04 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: faraday
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
25
|
none: false
|
18
|
-
requirements:
|
26
|
+
requirements:
|
19
27
|
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 63
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 8
|
33
|
+
- 0
|
34
|
+
version: 0.8.0
|
22
35
|
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: mail
|
23
39
|
prerelease: false
|
24
|
-
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
25
41
|
none: false
|
26
|
-
requirements:
|
42
|
+
requirements:
|
27
43
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 29
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 5
|
49
|
+
- 3
|
29
50
|
version: 2.5.3
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: multimap
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 1.1.2
|
38
51
|
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: multimap
|
39
55
|
prerelease: false
|
40
|
-
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
57
|
none: false
|
42
|
-
requirements:
|
58
|
+
requirements:
|
43
59
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 23
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 1
|
65
|
+
- 2
|
45
66
|
version: 1.1.2
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rack
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ~>
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '1.4'
|
54
67
|
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rack
|
55
71
|
prerelease: false
|
56
|
-
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
57
73
|
none: false
|
58
|
-
requirements:
|
74
|
+
requirements:
|
59
75
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 7
|
78
|
+
segments:
|
79
|
+
- 1
|
80
|
+
- 4
|
81
|
+
version: "1.4"
|
82
|
+
type: :runtime
|
83
|
+
version_requirements: *id004
|
84
|
+
- !ruby/object:Gem::Dependency
|
63
85
|
name: coveralls
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
86
|
prerelease: false
|
72
|
-
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: json
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
88
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 3
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
86
96
|
type: :development
|
97
|
+
version_requirements: *id005
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: json
|
87
100
|
prerelease: false
|
88
|
-
|
101
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
89
102
|
none: false
|
90
|
-
requirements:
|
103
|
+
requirements:
|
91
104
|
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 5
|
107
|
+
segments:
|
108
|
+
- 1
|
109
|
+
- 7
|
110
|
+
- 7
|
93
111
|
version: 1.7.7
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: rake
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
112
|
type: :development
|
113
|
+
version_requirements: *id006
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: rake
|
103
116
|
prerelease: false
|
104
|
-
|
117
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
105
118
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 3
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
version: "0"
|
126
|
+
type: :development
|
127
|
+
version_requirements: *id007
|
128
|
+
- !ruby/object:Gem::Dependency
|
111
129
|
name: rspec
|
112
|
-
|
130
|
+
prerelease: false
|
131
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
113
132
|
none: false
|
114
|
-
requirements:
|
133
|
+
requirements:
|
115
134
|
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
hash: 23
|
137
|
+
segments:
|
138
|
+
- 2
|
139
|
+
- 10
|
140
|
+
version: "2.10"
|
118
141
|
type: :development
|
142
|
+
version_requirements: *id008
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: vcr
|
119
145
|
prerelease: false
|
120
|
-
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '2.10'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: mandrill-api
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
129
147
|
none: false
|
130
|
-
requirements:
|
148
|
+
requirements:
|
131
149
|
- - ~>
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
hash: 3
|
152
|
+
segments:
|
153
|
+
- 2
|
154
|
+
- 0
|
155
|
+
version: "2.0"
|
134
156
|
type: :development
|
157
|
+
version_requirements: *id009
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: mandrill-api
|
135
160
|
prerelease: false
|
136
|
-
|
161
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
137
162
|
none: false
|
138
|
-
requirements:
|
163
|
+
requirements:
|
139
164
|
- - ~>
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
- - ! '>='
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
hash: 81
|
167
|
+
segments:
|
168
|
+
- 1
|
169
|
+
- 0
|
170
|
+
- 35
|
171
|
+
version: 1.0.35
|
150
172
|
type: :development
|
173
|
+
version_requirements: *id010
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: postmark
|
151
176
|
prerelease: false
|
152
|
-
|
177
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
153
178
|
none: false
|
154
|
-
requirements:
|
155
|
-
- -
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
|
158
|
-
|
179
|
+
requirements:
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
hash: 3
|
183
|
+
segments:
|
184
|
+
- 0
|
185
|
+
version: "0"
|
186
|
+
type: :development
|
187
|
+
version_requirements: *id011
|
188
|
+
- !ruby/object:Gem::Dependency
|
159
189
|
name: rest-client
|
160
|
-
|
190
|
+
prerelease: false
|
191
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
161
192
|
none: false
|
162
|
-
requirements:
|
193
|
+
requirements:
|
163
194
|
- - ~>
|
164
|
-
- !ruby/object:Gem::Version
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
hash: 1
|
197
|
+
segments:
|
198
|
+
- 1
|
199
|
+
- 6
|
200
|
+
- 7
|
165
201
|
version: 1.6.7
|
166
202
|
type: :development
|
203
|
+
version_requirements: *id012
|
204
|
+
- !ruby/object:Gem::Dependency
|
205
|
+
name: sendgrid_webapi
|
167
206
|
prerelease: false
|
168
|
-
|
207
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
169
208
|
none: false
|
170
|
-
requirements:
|
171
|
-
- -
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
|
209
|
+
requirements:
|
210
|
+
- - ">="
|
211
|
+
- !ruby/object:Gem::Version
|
212
|
+
hash: 3
|
213
|
+
segments:
|
214
|
+
- 0
|
215
|
+
version: "0"
|
216
|
+
type: :development
|
217
|
+
version_requirements: *id013
|
174
218
|
description:
|
175
|
-
email:
|
219
|
+
email:
|
176
220
|
- info@opennorth.ca
|
177
221
|
executables: []
|
222
|
+
|
178
223
|
extensions: []
|
224
|
+
|
179
225
|
extra_rdoc_files: []
|
180
|
-
|
226
|
+
|
227
|
+
files:
|
181
228
|
- .gitignore
|
182
229
|
- .travis.yml
|
183
230
|
- .yardopts
|
@@ -188,21 +235,23 @@ files:
|
|
188
235
|
- USAGE
|
189
236
|
- lib/multi_mail.rb
|
190
237
|
- lib/multi_mail/cloudmailin/receiver.rb
|
238
|
+
- lib/multi_mail/mailgun/message.rb
|
191
239
|
- lib/multi_mail/mailgun/receiver.rb
|
192
240
|
- lib/multi_mail/mailgun/sender.rb
|
241
|
+
- lib/multi_mail/mandrill/message.rb
|
193
242
|
- lib/multi_mail/mandrill/receiver.rb
|
194
243
|
- lib/multi_mail/mandrill/sender.rb
|
244
|
+
- lib/multi_mail/message/base.rb
|
195
245
|
- lib/multi_mail/postmark/receiver.rb
|
196
246
|
- lib/multi_mail/postmark/sender.rb
|
197
247
|
- lib/multi_mail/receiver.rb
|
198
248
|
- lib/multi_mail/receiver/base.rb
|
199
|
-
- lib/multi_mail/sender.rb
|
200
249
|
- lib/multi_mail/sender/base.rb
|
250
|
+
- lib/multi_mail/sendgrid/message.rb
|
201
251
|
- lib/multi_mail/sendgrid/receiver.rb
|
202
252
|
- lib/multi_mail/sendgrid/sender.rb
|
203
253
|
- lib/multi_mail/service.rb
|
204
254
|
- lib/multi_mail/simple/receiver.rb
|
205
|
-
- lib/multi_mail/simple/sender.rb
|
206
255
|
- lib/multi_mail/version.rb
|
207
256
|
- multi_mail.gemspec
|
208
257
|
- spec/cloudmailin/receiver_spec.rb
|
@@ -212,62 +261,81 @@ files:
|
|
212
261
|
- spec/fixtures/cloudmailin/multipart/valid.txt
|
213
262
|
- spec/fixtures/cloudmailin/raw/spam.txt
|
214
263
|
- spec/fixtures/cloudmailin/raw/valid.txt
|
264
|
+
- spec/fixtures/empty.gif
|
215
265
|
- spec/fixtures/mailgun/parsed/invalid.txt
|
216
266
|
- spec/fixtures/mailgun/parsed/missing.txt
|
217
267
|
- spec/fixtures/mailgun/parsed/spam.txt
|
218
268
|
- spec/fixtures/mailgun/parsed/valid.txt
|
269
|
+
- spec/fixtures/mailgun/raw/invalid.txt
|
270
|
+
- spec/fixtures/mailgun/raw/missing.txt
|
271
|
+
- spec/fixtures/mailgun/raw/spam.txt
|
272
|
+
- spec/fixtures/mailgun/raw/valid.txt
|
273
|
+
- spec/fixtures/mandrill/invalid.txt
|
274
|
+
- spec/fixtures/mandrill/missing.txt
|
275
|
+
- spec/fixtures/mandrill/multiple.txt
|
219
276
|
- spec/fixtures/mandrill/spam.txt
|
220
277
|
- spec/fixtures/mandrill/valid.txt
|
221
278
|
- spec/fixtures/multipart.txt
|
222
279
|
- spec/fixtures/postmark/spam.txt
|
223
280
|
- spec/fixtures/postmark/valid.txt
|
281
|
+
- spec/fixtures/sendgrid/encoding.txt
|
282
|
+
- spec/fixtures/sendgrid/spam.txt
|
283
|
+
- spec/fixtures/sendgrid/valid.txt
|
224
284
|
- spec/fixtures/simple/valid.txt
|
285
|
+
- spec/mailgun/message_spec.rb
|
225
286
|
- spec/mailgun/receiver_spec.rb
|
226
287
|
- spec/mailgun/sender_spec.rb
|
288
|
+
- spec/mandrill/message_spec.rb
|
227
289
|
- spec/mandrill/receiver_spec.rb
|
228
290
|
- spec/mandrill/sender_spec.rb
|
291
|
+
- spec/message/base_spec.rb
|
229
292
|
- spec/multi_mail_spec.rb
|
230
293
|
- spec/postmark/receiver_spec.rb
|
231
294
|
- spec/postmark/sender_spec.rb
|
232
295
|
- spec/receiver/base_spec.rb
|
233
296
|
- spec/receiver_spec.rb
|
234
297
|
- spec/sender/base_spec.rb
|
235
|
-
- spec/
|
298
|
+
- spec/sendgrid/message_spec.rb
|
299
|
+
- spec/sendgrid/receiver_spec.rb
|
300
|
+
- spec/sendgrid/sender_spec.rb
|
236
301
|
- spec/service_spec.rb
|
237
302
|
- spec/simple/receiver_spec.rb
|
238
|
-
- spec/simple/sender_spec.rb
|
239
303
|
- spec/spec_helper.rb
|
304
|
+
has_rdoc: true
|
240
305
|
homepage: http://github.com/opennorth/multi_mail
|
241
306
|
licenses: []
|
307
|
+
|
242
308
|
post_install_message:
|
243
309
|
rdoc_options: []
|
244
|
-
|
310
|
+
|
311
|
+
require_paths:
|
245
312
|
- lib
|
246
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
313
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
247
314
|
none: false
|
248
|
-
requirements:
|
249
|
-
- -
|
250
|
-
- !ruby/object:Gem::Version
|
251
|
-
|
252
|
-
segments:
|
315
|
+
requirements:
|
316
|
+
- - ">="
|
317
|
+
- !ruby/object:Gem::Version
|
318
|
+
hash: 3
|
319
|
+
segments:
|
253
320
|
- 0
|
254
|
-
|
255
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
321
|
+
version: "0"
|
322
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
256
323
|
none: false
|
257
|
-
requirements:
|
258
|
-
- -
|
259
|
-
- !ruby/object:Gem::Version
|
260
|
-
|
261
|
-
segments:
|
324
|
+
requirements:
|
325
|
+
- - ">="
|
326
|
+
- !ruby/object:Gem::Version
|
327
|
+
hash: 3
|
328
|
+
segments:
|
262
329
|
- 0
|
263
|
-
|
330
|
+
version: "0"
|
264
331
|
requirements: []
|
332
|
+
|
265
333
|
rubyforge_project:
|
266
|
-
rubygems_version: 1.
|
334
|
+
rubygems_version: 1.6.2
|
267
335
|
signing_key:
|
268
336
|
specification_version: 3
|
269
337
|
summary: Easily switch between email APIs
|
270
|
-
test_files:
|
338
|
+
test_files:
|
271
339
|
- spec/cloudmailin/receiver_spec.rb
|
272
340
|
- spec/fixtures/cloudmailin/json/spam.txt
|
273
341
|
- spec/fixtures/cloudmailin/json/valid.txt
|
@@ -275,28 +343,43 @@ test_files:
|
|
275
343
|
- spec/fixtures/cloudmailin/multipart/valid.txt
|
276
344
|
- spec/fixtures/cloudmailin/raw/spam.txt
|
277
345
|
- spec/fixtures/cloudmailin/raw/valid.txt
|
346
|
+
- spec/fixtures/empty.gif
|
278
347
|
- spec/fixtures/mailgun/parsed/invalid.txt
|
279
348
|
- spec/fixtures/mailgun/parsed/missing.txt
|
280
349
|
- spec/fixtures/mailgun/parsed/spam.txt
|
281
350
|
- spec/fixtures/mailgun/parsed/valid.txt
|
351
|
+
- spec/fixtures/mailgun/raw/invalid.txt
|
352
|
+
- spec/fixtures/mailgun/raw/missing.txt
|
353
|
+
- spec/fixtures/mailgun/raw/spam.txt
|
354
|
+
- spec/fixtures/mailgun/raw/valid.txt
|
355
|
+
- spec/fixtures/mandrill/invalid.txt
|
356
|
+
- spec/fixtures/mandrill/missing.txt
|
357
|
+
- spec/fixtures/mandrill/multiple.txt
|
282
358
|
- spec/fixtures/mandrill/spam.txt
|
283
359
|
- spec/fixtures/mandrill/valid.txt
|
284
360
|
- spec/fixtures/multipart.txt
|
285
361
|
- spec/fixtures/postmark/spam.txt
|
286
362
|
- spec/fixtures/postmark/valid.txt
|
363
|
+
- spec/fixtures/sendgrid/encoding.txt
|
364
|
+
- spec/fixtures/sendgrid/spam.txt
|
365
|
+
- spec/fixtures/sendgrid/valid.txt
|
287
366
|
- spec/fixtures/simple/valid.txt
|
367
|
+
- spec/mailgun/message_spec.rb
|
288
368
|
- spec/mailgun/receiver_spec.rb
|
289
369
|
- spec/mailgun/sender_spec.rb
|
370
|
+
- spec/mandrill/message_spec.rb
|
290
371
|
- spec/mandrill/receiver_spec.rb
|
291
372
|
- spec/mandrill/sender_spec.rb
|
373
|
+
- spec/message/base_spec.rb
|
292
374
|
- spec/multi_mail_spec.rb
|
293
375
|
- spec/postmark/receiver_spec.rb
|
294
376
|
- spec/postmark/sender_spec.rb
|
295
377
|
- spec/receiver/base_spec.rb
|
296
378
|
- spec/receiver_spec.rb
|
297
379
|
- spec/sender/base_spec.rb
|
298
|
-
- spec/
|
380
|
+
- spec/sendgrid/message_spec.rb
|
381
|
+
- spec/sendgrid/receiver_spec.rb
|
382
|
+
- spec/sendgrid/sender_spec.rb
|
299
383
|
- spec/service_spec.rb
|
300
384
|
- spec/simple/receiver_spec.rb
|
301
|
-
- spec/simple/sender_spec.rb
|
302
385
|
- spec/spec_helper.rb
|
data/lib/multi_mail/sender.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
module MultiMail
|
2
|
-
# Endpoint for initializing different outgoing email senders.
|
3
|
-
#
|
4
|
-
# @see http://rdoc.info/gems/fog/Fog/Storage
|
5
|
-
module Sender
|
6
|
-
# Initializers an outgoing email sender.
|
7
|
-
#
|
8
|
-
# @example
|
9
|
-
# require 'multi_mail'
|
10
|
-
# service = MultiMail::Sender.new({
|
11
|
-
# :provider => 'mailgun',
|
12
|
-
# :mailgun_api_key => 'key-xxxxxxxxxxxxxxxxxxxxxxx-x-xxxxxx',
|
13
|
-
# })
|
14
|
-
#
|
15
|
-
# @param [Hash] attributes required arguments
|
16
|
-
# @option attributes [String,Symbol] :provider a provider
|
17
|
-
# @return [MultiMail::Service] an outgoing email sender
|
18
|
-
# @raise [ArgumentError] if the provider does not exist
|
19
|
-
# @see Fog::Storage::new
|
20
|
-
def self.new(attributes)
|
21
|
-
attributes = attributes.dup # prevent delete from having side effects
|
22
|
-
case provider = attributes.delete(:provider).to_s.downcase.to_sym
|
23
|
-
when :mailgun
|
24
|
-
require 'multi_mail/mailgun/sender'
|
25
|
-
MultiMail::Sender::Mailgun.new(attributes)
|
26
|
-
when :mandrill
|
27
|
-
require 'multi_mail/mandrill/sender'
|
28
|
-
MultiMail::Sender::Mandrill.new(attributes)
|
29
|
-
when :postmark
|
30
|
-
require 'multi_mail/postmark/sender'
|
31
|
-
MultiMail::Sender::Postmark.new(attributes)
|
32
|
-
when :sendgrid
|
33
|
-
require 'multi_mail/sendgrid/sender'
|
34
|
-
MultiMail::Sender::SendGrid.new(attributes)
|
35
|
-
when :simple
|
36
|
-
require 'multi_mail/simple/sender'
|
37
|
-
MultiMail::Sender::Simple.new(attributes)
|
38
|
-
when :mock
|
39
|
-
# for testing
|
40
|
-
MultiMail::Sender::Mock.new(attributes)
|
41
|
-
else
|
42
|
-
raise ArgumentError.new("#{provider} is not a recognized provider")
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
data/spec/sender_spec.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe MultiMail::Sender do
|
4
|
-
describe '#new' do
|
5
|
-
it 'should not raise an error if the provider is recognized' do
|
6
|
-
expect{ MultiMail::Sender.new :provider => :mailgun, :mailgun_api_key => 1 }.to_not raise_error
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should raise an error if the provider is not recognized' do
|
10
|
-
expect{ MultiMail::Sender.new :provider => :foo }.to raise_error(ArgumentError)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
data/spec/simple/sender_spec.rb
DELETED
File without changes
|