multi_mail 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +57 -34
  3. data/bin/multi_mail_post +71 -0
  4. data/lib/mail_ext/message.rb +11 -0
  5. data/lib/multi_mail.rb +25 -8
  6. data/lib/multi_mail/cloudmailin/receiver.rb +24 -3
  7. data/lib/multi_mail/mailgun/message.rb +6 -1
  8. data/lib/multi_mail/mailgun/sender.rb +4 -4
  9. data/lib/multi_mail/mandrill/message.rb +4 -3
  10. data/lib/multi_mail/mandrill/sender.rb +9 -2
  11. data/lib/multi_mail/message/base.rb +14 -0
  12. data/lib/multi_mail/postmark/message.rb +74 -0
  13. data/lib/multi_mail/postmark/receiver.rb +2 -1
  14. data/lib/multi_mail/postmark/sender.rb +54 -24
  15. data/lib/multi_mail/sendgrid/message.rb +4 -4
  16. data/lib/multi_mail/sendgrid/sender.rb +2 -2
  17. data/lib/multi_mail/simple/receiver.rb +31 -1
  18. data/lib/multi_mail/version.rb +1 -1
  19. data/multi_mail.gemspec +2 -1
  20. data/spec/cloudmailin/receiver_spec.rb +89 -84
  21. data/spec/fixtures/cloudmailin/json/attachment_store.txt +65 -0
  22. data/spec/fixtures/cloudmailin/multipart/attachment_store.txt +174 -0
  23. data/spec/fixtures/cloudmailin/raw/attachment_store.txt +162 -0
  24. data/spec/fixtures/mailgun/parsed/valid.txt +107 -101
  25. data/spec/fixtures/simple/invalid.txt +4 -0
  26. data/spec/fixtures/simple/missing.txt +4 -0
  27. data/spec/fixtures/simple/valid.txt +1 -1
  28. data/spec/mail_ext/message_spec.rb +45 -0
  29. data/spec/mailgun/message_spec.rb +38 -8
  30. data/spec/mailgun/receiver_spec.rb +104 -110
  31. data/spec/mailgun/sender_spec.rb +13 -7
  32. data/spec/mandrill/message_spec.rb +25 -1
  33. data/spec/mandrill/receiver_spec.rb +81 -83
  34. data/spec/mandrill/sender_spec.rb +13 -6
  35. data/spec/message/base_spec.rb +33 -1
  36. data/spec/postmark/message_spec.rb +292 -0
  37. data/spec/postmark/receiver_spec.rb +46 -48
  38. data/spec/postmark/sender_spec.rb +10 -10
  39. data/spec/sendgrid/message_spec.rb +6 -1
  40. data/spec/sendgrid/receiver_spec.rb +56 -58
  41. data/spec/sendgrid/sender_spec.rb +9 -7
  42. data/spec/service_spec.rb +1 -1
  43. data/spec/simple/receiver_spec.rb +38 -25
  44. data/spec/spec_helper.rb +6 -8
  45. metadata +185 -203
data/spec/spec_helper.rb CHANGED
@@ -18,7 +18,7 @@ if RUBY_VERSION >= '1.9'
18
18
  c.hook_into :faraday
19
19
 
20
20
  c.around_http_request do |request| # Ruby 1.9+
21
- VCR.use_cassette(Digest::SHA1.hexdigest(request.uri + request.body), &request)
21
+ VCR.use_cassette(Digest::SHA1.hexdigest(request.uri + request.body + request.headers.to_s), &request)
22
22
  end
23
23
  end
24
24
  end
@@ -27,9 +27,10 @@ end
27
27
  # in spec/support/ and its subdirectories.
28
28
  Dir[File.expand_path("../support/**/*.rb", __FILE__)].each {|f| require f}
29
29
 
30
- # Use requestb.in. Copy the content from the "Raw" tab and replace the first
31
- # line with "HTTP/1.1 200 OK". Note that messages cannot exceed 10kb. All
32
- # fixtures are modified to have the same Date header.
30
+ # Use Rackbin. Prepend "HTTP/1.1 200 OK" to the request. All fixtures are
31
+ # modified to have the same Date header.
32
+ #
33
+ # If you see `bad content body` exceptions, run `unix2dos` on the fixtures.
33
34
  #
34
35
  # Sign up for all services, and, in all cases except Cloudmailin, add an API key
35
36
  # to `api_keys.yml`, which will look like:
@@ -43,12 +44,9 @@ Dir[File.expand_path("../support/**/*.rb", __FILE__)].each {|f| require f}
43
44
  #
44
45
  # For Postmark, you must create a server to get an API key.
45
46
  #
46
- # If you see `bad content body` exceptions, run `unix2dos` on the fixtures.
47
- #
48
47
  # # Cloudmailin
49
48
  #
50
- # Change the HTTP POST format on Cloudmailin and wait a few minutes. Run
51
- # `unix2dos` on the fixtures to fix line endings.
49
+ # Change the HTTP POST format on Cloudmailin and wait up to a few minutes.
52
50
  #
53
51
  # spam.txt Change the SPF result to "fail"
54
52
  # valid.txt Send a complex multipart message
metadata CHANGED
@@ -1,230 +1,205 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: multi_mail
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Open North
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-07-04 00:00:00 -04:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: faraday
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
27
17
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 63
30
- segments:
31
- - 0
32
- - 8
33
- - 0
18
+ - !ruby/object:Gem::Version
34
19
  version: 0.8.0
35
20
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: mail
39
21
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: mail
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
43
31
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 29
46
- segments:
47
- - 2
48
- - 5
49
- - 3
32
+ - !ruby/object:Gem::Version
50
33
  version: 2.5.3
51
34
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: multimap
55
35
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
59
38
  - - ~>
60
- - !ruby/object:Gem::Version
61
- hash: 23
62
- segments:
63
- - 1
64
- - 1
65
- - 2
39
+ - !ruby/object:Gem::Version
40
+ version: 2.5.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: multimap
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
66
47
  version: 1.1.2
67
48
  type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: rack
71
49
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
75
52
  - - ~>
76
- - !ruby/object:Gem::Version
77
- hash: 7
78
- segments:
79
- - 1
80
- - 4
81
- version: "1.4"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.1.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: rack
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.4'
82
62
  type: :runtime
83
- version_requirements: *id004
84
- - !ruby/object:Gem::Dependency
85
- name: coveralls
86
63
  prerelease: false
87
- requirement: &id005 !ruby/object:Gem::Requirement
88
- none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
96
76
  type: :development
97
- version_requirements: *id005
98
- - !ruby/object:Gem::Dependency
99
- name: json
100
77
  prerelease: false
101
- requirement: &id006 !ruby/object:Gem::Requirement
102
- none: false
103
- requirements:
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: json
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
104
87
  - - ~>
105
- - !ruby/object:Gem::Version
106
- hash: 5
107
- segments:
108
- - 1
109
- - 7
110
- - 7
88
+ - !ruby/object:Gem::Version
111
89
  version: 1.7.7
112
90
  type: :development
113
- version_requirements: *id006
114
- - !ruby/object:Gem::Dependency
115
- name: rake
116
91
  prerelease: false
117
- requirement: &id007 !ruby/object:Gem::Requirement
118
- none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- hash: 3
123
- segments:
124
- - 0
125
- version: "0"
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 1.7.7
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
126
104
  type: :development
127
- version_requirements: *id007
128
- - !ruby/object:Gem::Dependency
129
- name: rspec
130
105
  prerelease: false
131
- requirement: &id008 !ruby/object:Gem::Requirement
132
- none: false
133
- requirements:
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
134
115
  - - ~>
135
- - !ruby/object:Gem::Version
136
- hash: 23
137
- segments:
138
- - 2
139
- - 10
140
- version: "2.10"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.10'
141
118
  type: :development
142
- version_requirements: *id008
143
- - !ruby/object:Gem::Dependency
144
- name: vcr
145
119
  prerelease: false
146
- requirement: &id009 !ruby/object:Gem::Requirement
147
- none: false
148
- requirements:
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '2.10'
125
+ - !ruby/object:Gem::Dependency
126
+ name: vcr
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
149
129
  - - ~>
150
- - !ruby/object:Gem::Version
151
- hash: 3
152
- segments:
153
- - 2
154
- - 0
155
- version: "2.0"
130
+ - !ruby/object:Gem::Version
131
+ version: 2.4.0
156
132
  type: :development
157
- version_requirements: *id009
158
- - !ruby/object:Gem::Dependency
159
- name: mandrill-api
160
133
  prerelease: false
161
- requirement: &id010 !ruby/object:Gem::Requirement
162
- none: false
163
- requirements:
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
164
136
  - - ~>
165
- - !ruby/object:Gem::Version
166
- hash: 81
167
- segments:
168
- - 1
169
- - 0
170
- - 35
137
+ - !ruby/object:Gem::Version
138
+ version: 2.4.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: mandrill-api
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
171
145
  version: 1.0.35
172
146
  type: :development
173
- version_requirements: *id010
174
- - !ruby/object:Gem::Dependency
175
- name: postmark
176
147
  prerelease: false
177
- requirement: &id011 !ruby/object:Gem::Requirement
178
- none: false
179
- requirements:
180
- - - ">="
181
- - !ruby/object:Gem::Version
182
- hash: 3
183
- segments:
184
- - 0
185
- version: "0"
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: 1.0.35
153
+ - !ruby/object:Gem::Dependency
154
+ name: postmark
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
186
160
  type: :development
187
- version_requirements: *id011
188
- - !ruby/object:Gem::Dependency
189
- name: rest-client
190
161
  prerelease: false
191
- requirement: &id012 !ruby/object:Gem::Requirement
192
- none: false
193
- requirements:
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rest-client
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
194
171
  - - ~>
195
- - !ruby/object:Gem::Version
196
- hash: 1
197
- segments:
198
- - 1
199
- - 6
200
- - 7
172
+ - !ruby/object:Gem::Version
201
173
  version: 1.6.7
202
174
  type: :development
203
- version_requirements: *id012
204
- - !ruby/object:Gem::Dependency
205
- name: sendgrid_webapi
206
175
  prerelease: false
207
- requirement: &id013 !ruby/object:Gem::Requirement
208
- none: false
209
- requirements:
210
- - - ">="
211
- - !ruby/object:Gem::Version
212
- hash: 3
213
- segments:
214
- - 0
215
- version: "0"
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ~>
179
+ - !ruby/object:Gem::Version
180
+ version: 1.6.7
181
+ - !ruby/object:Gem::Dependency
182
+ name: sendgrid_webapi
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
216
188
  type: :development
217
- version_requirements: *id013
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
218
195
  description:
219
- email:
196
+ email:
220
197
  - info@opennorth.ca
221
- executables: []
222
-
198
+ executables:
199
+ - multi_mail_post
223
200
  extensions: []
224
-
225
201
  extra_rdoc_files: []
226
-
227
- files:
202
+ files:
228
203
  - .gitignore
229
204
  - .travis.yml
230
205
  - .yardopts
@@ -233,6 +208,8 @@ files:
233
208
  - README.md
234
209
  - Rakefile
235
210
  - USAGE
211
+ - bin/multi_mail_post
212
+ - lib/mail_ext/message.rb
236
213
  - lib/multi_mail.rb
237
214
  - lib/multi_mail/cloudmailin/receiver.rb
238
215
  - lib/multi_mail/mailgun/message.rb
@@ -242,6 +219,7 @@ files:
242
219
  - lib/multi_mail/mandrill/receiver.rb
243
220
  - lib/multi_mail/mandrill/sender.rb
244
221
  - lib/multi_mail/message/base.rb
222
+ - lib/multi_mail/postmark/message.rb
245
223
  - lib/multi_mail/postmark/receiver.rb
246
224
  - lib/multi_mail/postmark/sender.rb
247
225
  - lib/multi_mail/receiver.rb
@@ -255,10 +233,13 @@ files:
255
233
  - lib/multi_mail/version.rb
256
234
  - multi_mail.gemspec
257
235
  - spec/cloudmailin/receiver_spec.rb
236
+ - spec/fixtures/cloudmailin/json/attachment_store.txt
258
237
  - spec/fixtures/cloudmailin/json/spam.txt
259
238
  - spec/fixtures/cloudmailin/json/valid.txt
239
+ - spec/fixtures/cloudmailin/multipart/attachment_store.txt
260
240
  - spec/fixtures/cloudmailin/multipart/spam.txt
261
241
  - spec/fixtures/cloudmailin/multipart/valid.txt
242
+ - spec/fixtures/cloudmailin/raw/attachment_store.txt
262
243
  - spec/fixtures/cloudmailin/raw/spam.txt
263
244
  - spec/fixtures/cloudmailin/raw/valid.txt
264
245
  - spec/fixtures/empty.gif
@@ -281,7 +262,10 @@ files:
281
262
  - spec/fixtures/sendgrid/encoding.txt
282
263
  - spec/fixtures/sendgrid/spam.txt
283
264
  - spec/fixtures/sendgrid/valid.txt
265
+ - spec/fixtures/simple/invalid.txt
266
+ - spec/fixtures/simple/missing.txt
284
267
  - spec/fixtures/simple/valid.txt
268
+ - spec/mail_ext/message_spec.rb
285
269
  - spec/mailgun/message_spec.rb
286
270
  - spec/mailgun/receiver_spec.rb
287
271
  - spec/mailgun/sender_spec.rb
@@ -290,6 +274,7 @@ files:
290
274
  - spec/mandrill/sender_spec.rb
291
275
  - spec/message/base_spec.rb
292
276
  - spec/multi_mail_spec.rb
277
+ - spec/postmark/message_spec.rb
293
278
  - spec/postmark/receiver_spec.rb
294
279
  - spec/postmark/sender_spec.rb
295
280
  - spec/receiver/base_spec.rb
@@ -301,46 +286,39 @@ files:
301
286
  - spec/service_spec.rb
302
287
  - spec/simple/receiver_spec.rb
303
288
  - spec/spec_helper.rb
304
- has_rdoc: true
305
289
  homepage: http://github.com/opennorth/multi_mail
306
- licenses: []
307
-
290
+ licenses:
291
+ - MIT
292
+ metadata: {}
308
293
  post_install_message:
309
294
  rdoc_options: []
310
-
311
- require_paths:
295
+ require_paths:
312
296
  - lib
313
- required_ruby_version: !ruby/object:Gem::Requirement
314
- none: false
315
- requirements:
316
- - - ">="
317
- - !ruby/object:Gem::Version
318
- hash: 3
319
- segments:
320
- - 0
321
- version: "0"
322
- required_rubygems_version: !ruby/object:Gem::Requirement
323
- none: false
324
- requirements:
325
- - - ">="
326
- - !ruby/object:Gem::Version
327
- hash: 3
328
- segments:
329
- - 0
330
- version: "0"
297
+ required_ruby_version: !ruby/object:Gem::Requirement
298
+ requirements:
299
+ - - '>='
300
+ - !ruby/object:Gem::Version
301
+ version: '0'
302
+ required_rubygems_version: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - '>='
305
+ - !ruby/object:Gem::Version
306
+ version: '0'
331
307
  requirements: []
332
-
333
308
  rubyforge_project:
334
- rubygems_version: 1.6.2
309
+ rubygems_version: 2.0.8
335
310
  signing_key:
336
- specification_version: 3
311
+ specification_version: 4
337
312
  summary: Easily switch between email APIs
338
- test_files:
313
+ test_files:
339
314
  - spec/cloudmailin/receiver_spec.rb
315
+ - spec/fixtures/cloudmailin/json/attachment_store.txt
340
316
  - spec/fixtures/cloudmailin/json/spam.txt
341
317
  - spec/fixtures/cloudmailin/json/valid.txt
318
+ - spec/fixtures/cloudmailin/multipart/attachment_store.txt
342
319
  - spec/fixtures/cloudmailin/multipart/spam.txt
343
320
  - spec/fixtures/cloudmailin/multipart/valid.txt
321
+ - spec/fixtures/cloudmailin/raw/attachment_store.txt
344
322
  - spec/fixtures/cloudmailin/raw/spam.txt
345
323
  - spec/fixtures/cloudmailin/raw/valid.txt
346
324
  - spec/fixtures/empty.gif
@@ -363,7 +341,10 @@ test_files:
363
341
  - spec/fixtures/sendgrid/encoding.txt
364
342
  - spec/fixtures/sendgrid/spam.txt
365
343
  - spec/fixtures/sendgrid/valid.txt
344
+ - spec/fixtures/simple/invalid.txt
345
+ - spec/fixtures/simple/missing.txt
366
346
  - spec/fixtures/simple/valid.txt
347
+ - spec/mail_ext/message_spec.rb
367
348
  - spec/mailgun/message_spec.rb
368
349
  - spec/mailgun/receiver_spec.rb
369
350
  - spec/mailgun/sender_spec.rb
@@ -372,6 +353,7 @@ test_files:
372
353
  - spec/mandrill/sender_spec.rb
373
354
  - spec/message/base_spec.rb
374
355
  - spec/multi_mail_spec.rb
356
+ - spec/postmark/message_spec.rb
375
357
  - spec/postmark/receiver_spec.rb
376
358
  - spec/postmark/sender_spec.rb
377
359
  - spec/receiver/base_spec.rb