multi_mail 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/multi_mail.rb +1 -1
- data/lib/multi_mail/multimap.rb +63 -0
- data/lib/multi_mail/postmark/message.rb +2 -2
- data/lib/multi_mail/postmark/sender.rb +1 -1
- data/lib/multi_mail/receiver/base.rb +1 -1
- data/lib/multi_mail/version.rb +1 -1
- data/multi_mail.gemspec +0 -1
- data/spec/postmark/sender_spec.rb +1 -1
- metadata +160 -209
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fcb39c73b30d0f52705ccc4d3f24bcb1142a974d
|
4
|
+
data.tar.gz: c1a3e5183e6755f559475f3a4dcda2f8103d89fb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b93ac384cfad8aa761a4cf21073a1c5ac4379493be11e8823f82006b8b8f2500e0868a5a1f545c09f22ecde04e107ec54d3cba42aaedfbb6f27a03e6f7f84196
|
7
|
+
data.tar.gz: f850d3ba49bc77ba05a54d0851920495bfa8ae4030d5a6f574d436009b6a115032b3e1ac5bccf0e59251ce379425ca6161713b6a6c12733598069628662dfffd
|
data/lib/multi_mail.rb
CHANGED
@@ -6,7 +6,6 @@ require 'iconv' unless RUBY_VERSION >= '1.9'
|
|
6
6
|
|
7
7
|
require 'faraday'
|
8
8
|
require 'mail'
|
9
|
-
require 'multimap'
|
10
9
|
require 'rack'
|
11
10
|
|
12
11
|
require 'mail_ext/message'
|
@@ -101,6 +100,7 @@ module MultiMail
|
|
101
100
|
end
|
102
101
|
end
|
103
102
|
|
103
|
+
require 'multi_mail/multimap'
|
104
104
|
require 'multi_mail/service'
|
105
105
|
require 'multi_mail/receiver'
|
106
106
|
require 'multi_mail/message/base'
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# @note The multimap gem was yanked, so we re-implement its functionality.
|
2
|
+
# @see https://github.com/josh/multimap
|
3
|
+
module MultiMail
|
4
|
+
class Multimap
|
5
|
+
def initialize
|
6
|
+
@hash = {}
|
7
|
+
end
|
8
|
+
|
9
|
+
def [](key)
|
10
|
+
@hash[key]
|
11
|
+
end
|
12
|
+
|
13
|
+
def []=(key, value)
|
14
|
+
@hash[key] ||= []
|
15
|
+
@hash[key] << value
|
16
|
+
end
|
17
|
+
|
18
|
+
def ==(other)
|
19
|
+
if Multimap === other
|
20
|
+
@hash == other.hash
|
21
|
+
else
|
22
|
+
@hash == other
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def size
|
27
|
+
@hash.values.flatten.size
|
28
|
+
end
|
29
|
+
|
30
|
+
def each_pair
|
31
|
+
@hash.each_pair do |key,values|
|
32
|
+
values.each do |value|
|
33
|
+
yield key, value
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def merge(other)
|
39
|
+
dup.update(other)
|
40
|
+
end
|
41
|
+
|
42
|
+
def update(other)
|
43
|
+
if Multimap === other
|
44
|
+
other.each_pair do |key,value|
|
45
|
+
self[key] = value
|
46
|
+
end
|
47
|
+
else
|
48
|
+
raise ArgumentError
|
49
|
+
end
|
50
|
+
self
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_hash
|
54
|
+
@hash.dup
|
55
|
+
end
|
56
|
+
|
57
|
+
protected
|
58
|
+
|
59
|
+
def hash
|
60
|
+
@hash
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -4,7 +4,7 @@ module MultiMail
|
|
4
4
|
class Postmark < MultiMail::Message::Base
|
5
5
|
# Returns the message headers in Postmark format.
|
6
6
|
#
|
7
|
-
# @return [
|
7
|
+
# @return [Array<Hash>] the message headers in Postmark format
|
8
8
|
def postmark_headers
|
9
9
|
array = []
|
10
10
|
header_fields.each do |field|
|
@@ -20,7 +20,7 @@ module MultiMail
|
|
20
20
|
|
21
21
|
# Returns the message's attachments in Postmark format.
|
22
22
|
#
|
23
|
-
# @return [
|
23
|
+
# @return [Array<Hash>] the attachments in Postmark format
|
24
24
|
# @see http://developer.postmarkapp.com/developer-build.html#attachments
|
25
25
|
def postmark_attachments
|
26
26
|
attachments.map do |attachment|
|
data/lib/multi_mail/version.rb
CHANGED
data/multi_mail.gemspec
CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.add_runtime_dependency 'faraday', '~> 0.8.0'
|
20
20
|
s.add_runtime_dependency 'mail', '~> 2.5.3' # Rails 3.2.13, less buggy than 2.4.x
|
21
|
-
s.add_runtime_dependency 'multimap', '~> 1.1.2'
|
22
21
|
s.add_runtime_dependency 'rack', '~> 1.4'
|
23
22
|
|
24
23
|
# For testing
|
@@ -65,7 +65,7 @@ describe MultiMail::Sender::Postmark do
|
|
65
65
|
expect{
|
66
66
|
message.delivery_method MultiMail::Sender::Postmark, :api_key => 'xxx'
|
67
67
|
message.deliver
|
68
|
-
}.to raise_error(MultiMail::InvalidAPIKey, 'Bad or missing
|
68
|
+
}.to raise_error(MultiMail::InvalidAPIKey, 'Bad or missing Server API token.')
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
metadata
CHANGED
@@ -1,234 +1,194 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi_mail
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 2
|
10
|
-
version: 0.1.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
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
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-04-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: faraday
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 63
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 8
|
33
|
-
- 0
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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:
|
31
|
+
- - "~>"
|
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
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
segments:
|
63
|
-
- 1
|
64
|
-
- 1
|
65
|
-
- 2
|
66
|
-
version: 1.1.2
|
67
|
-
type: :runtime
|
68
|
-
version_requirements: *id003
|
69
|
-
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.5.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
70
42
|
name: rack
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
hash: 7
|
78
|
-
segments:
|
79
|
-
- 1
|
80
|
-
- 4
|
81
|
-
version: "1.4"
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.4'
|
82
48
|
type: :runtime
|
83
|
-
version_requirements: *id004
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: coveralls
|
86
49
|
prerelease: false
|
87
|
-
|
88
|
-
|
89
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
90
59
|
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
version: "0"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
96
62
|
type: :development
|
97
|
-
version_requirements: *id005
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: json
|
100
63
|
prerelease: false
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: json
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
111
75
|
version: 1.7.7
|
112
76
|
type: :development
|
113
|
-
version_requirements: *id006
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
name: rake
|
116
77
|
prerelease: false
|
117
|
-
|
118
|
-
|
119
|
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.7.7
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
120
87
|
- - ">="
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
segments:
|
124
|
-
- 0
|
125
|
-
version: "0"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
126
90
|
type: :development
|
127
|
-
version_requirements: *id007
|
128
|
-
- !ruby/object:Gem::Dependency
|
129
|
-
name: rspec
|
130
91
|
prerelease: false
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.10'
|
141
104
|
type: :development
|
142
|
-
version_requirements: *id008
|
143
|
-
- !ruby/object:Gem::Dependency
|
144
|
-
name: vcr
|
145
105
|
prerelease: false
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.10'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: vcr
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
156
117
|
version: 2.4.0
|
157
118
|
type: :development
|
158
|
-
version_requirements: *id009
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
|
-
name: mandrill-api
|
161
119
|
prerelease: false
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.4.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: mandrill-api
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
172
131
|
version: 1.0.35
|
173
132
|
type: :development
|
174
|
-
version_requirements: *id010
|
175
|
-
- !ruby/object:Gem::Dependency
|
176
|
-
name: postmark
|
177
133
|
prerelease: false
|
178
|
-
|
179
|
-
|
180
|
-
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.0.35
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: postmark
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
181
143
|
- - ">="
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
|
184
|
-
segments:
|
185
|
-
- 0
|
186
|
-
version: "0"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
187
146
|
type: :development
|
188
|
-
version_requirements: *id011
|
189
|
-
- !ruby/object:Gem::Dependency
|
190
|
-
name: rest-client
|
191
147
|
prerelease: false
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rest-client
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
202
159
|
version: 1.6.7
|
203
160
|
type: :development
|
204
|
-
version_requirements: *id012
|
205
|
-
- !ruby/object:Gem::Dependency
|
206
|
-
name: sendgrid_webapi
|
207
161
|
prerelease: false
|
208
|
-
|
209
|
-
|
210
|
-
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 1.6.7
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: sendgrid_webapi
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
211
171
|
- - ">="
|
212
|
-
- !ruby/object:Gem::Version
|
213
|
-
|
214
|
-
segments:
|
215
|
-
- 0
|
216
|
-
version: "0"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
217
174
|
type: :development
|
218
|
-
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
219
181
|
description:
|
220
|
-
email:
|
182
|
+
email:
|
221
183
|
- info@opennorth.ca
|
222
|
-
executables:
|
184
|
+
executables:
|
223
185
|
- multi_mail_post
|
224
186
|
extensions: []
|
225
|
-
|
226
187
|
extra_rdoc_files: []
|
227
|
-
|
228
|
-
|
229
|
-
- .
|
230
|
-
- .
|
231
|
-
- .yardopts
|
188
|
+
files:
|
189
|
+
- ".gitignore"
|
190
|
+
- ".travis.yml"
|
191
|
+
- ".yardopts"
|
232
192
|
- Gemfile
|
233
193
|
- LICENSE
|
234
194
|
- README.md
|
@@ -245,6 +205,7 @@ files:
|
|
245
205
|
- lib/multi_mail/mandrill/receiver.rb
|
246
206
|
- lib/multi_mail/mandrill/sender.rb
|
247
207
|
- lib/multi_mail/message/base.rb
|
208
|
+
- lib/multi_mail/multimap.rb
|
248
209
|
- lib/multi_mail/postmark/message.rb
|
249
210
|
- lib/multi_mail/postmark/receiver.rb
|
250
211
|
- lib/multi_mail/postmark/sender.rb
|
@@ -312,41 +273,31 @@ files:
|
|
312
273
|
- spec/service_spec.rb
|
313
274
|
- spec/simple/receiver_spec.rb
|
314
275
|
- spec/spec_helper.rb
|
315
|
-
has_rdoc: true
|
316
276
|
homepage: http://github.com/opennorth/multi_mail
|
317
|
-
licenses:
|
277
|
+
licenses:
|
318
278
|
- MIT
|
279
|
+
metadata: {}
|
319
280
|
post_install_message:
|
320
281
|
rdoc_options: []
|
321
|
-
|
322
|
-
require_paths:
|
282
|
+
require_paths:
|
323
283
|
- lib
|
324
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
325
|
-
|
326
|
-
requirements:
|
284
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
285
|
+
requirements:
|
327
286
|
- - ">="
|
328
|
-
- !ruby/object:Gem::Version
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
version: "0"
|
333
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
334
|
-
none: false
|
335
|
-
requirements:
|
287
|
+
- !ruby/object:Gem::Version
|
288
|
+
version: '0'
|
289
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
290
|
+
requirements:
|
336
291
|
- - ">="
|
337
|
-
- !ruby/object:Gem::Version
|
338
|
-
|
339
|
-
segments:
|
340
|
-
- 0
|
341
|
-
version: "0"
|
292
|
+
- !ruby/object:Gem::Version
|
293
|
+
version: '0'
|
342
294
|
requirements: []
|
343
|
-
|
344
295
|
rubyforge_project:
|
345
|
-
rubygems_version:
|
296
|
+
rubygems_version: 2.2.2
|
346
297
|
signing_key:
|
347
|
-
specification_version:
|
298
|
+
specification_version: 4
|
348
299
|
summary: Easily switch between email APIs
|
349
|
-
test_files:
|
300
|
+
test_files:
|
350
301
|
- spec/cloudmailin/receiver_spec.rb
|
351
302
|
- spec/fixtures/cloudmailin/json/attachment_store.txt
|
352
303
|
- spec/fixtures/cloudmailin/json/spam.txt
|