postmark 0.9.11 → 0.9.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,23 +1,29 @@
1
1
  = Changelog
2
2
 
3
+ == 0.9.12
4
+
5
+ * Fixed a problem of attachments processing when using deliver! method on Mail object.
6
+ * Removed activesupport dependency for Postmark::AttachmentsFixForMail.
7
+ * Added specs for AttachmentFixForMail.
8
+
3
9
  == 0.9.11
4
10
 
5
- * Replaced Jeweler by Bundler
6
- * Updated RSpec to 2.8
7
- * Fixed specs
8
- * Refactored the codebase
11
+ * Replaced Jeweler by Bundler.
12
+ * Updated RSpec to 2.8.
13
+ * Fixed specs.
14
+ * Refactored the codebase.
9
15
 
10
16
  == 0.9.10
11
17
 
12
- * Fixed Ruby 1.9 compatibility issue
18
+ * Fixed Ruby 1.9 compatibility issue.
13
19
 
14
20
  == 0.9.9
15
21
 
16
- * Added support for non-array reply_to addresses
22
+ * Added support for non-array reply_to addresses.
17
23
 
18
24
  == 0.9.8
19
25
 
20
- * Fixed bug that caused unexpected multiple email deliveries on Ruby1.9.2/Rails3.0.7
26
+ * Fixed bug that caused unexpected multiple email deliveries on Ruby 1.9.2/Rails 3.0.7.
21
27
 
22
28
  == 0.9.7
23
29
 
@@ -110,6 +110,7 @@ You can also explicitly specify which one to be used, using
110
110
  * Ilya Sabanin
111
111
  * Hristo Deshev
112
112
  * Artem Chistyakov
113
+ * Dmitry Sabanin
113
114
  * Randy Schmidt
114
115
  * Chris Williams
115
116
  * Aitor García Rey
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.11
1
+ 0.9.12
@@ -19,25 +19,30 @@ module Postmark
19
19
  module AttachmentsFixForMail
20
20
 
21
21
  def self.included(base)
22
- base.class_eval do
23
- alias_method_chain :deliver, :postmark_hook
22
+ base.class_eval do
23
+ alias_method :deliver_without_postmark_hook, :deliver
24
+ alias_method :deliver_without_postmark_hook!, :deliver!
25
+
26
+ def deliver!
27
+ remove_postmark_attachments_from_standard_fields
28
+ deliver_without_postmark_hook!
29
+ end
30
+
31
+ def deliver
32
+ remove_postmark_attachments_from_standard_fields
33
+ deliver_without_postmark_hook
34
+ end
24
35
  end
25
36
  end
26
-
27
- def deliver_with_postmark_hook
28
- remove_postmark_attachments_from_standard_fields
29
- deliver_without_postmark_hook
30
- end
31
-
37
+
32
38
  private
33
-
39
+
34
40
  def remove_postmark_attachments_from_standard_fields
35
41
  field = self['POSTMARK-ATTACHMENTS']
36
42
  return if field.nil?
37
43
  self.postmark_attachments = field.value
38
44
  header.fields.delete_if{|f| f.name == 'postmark-attachments'}
39
45
  end
40
-
41
46
  end
42
47
 
43
48
  end
@@ -1,3 +1,3 @@
1
1
  module Postmark
2
- VERSION = "0.9.11"
2
+ VERSION = "0.9.12"
3
3
  end
@@ -158,6 +158,26 @@ describe Postmark do
158
158
  end
159
159
  end
160
160
 
161
+ context "attachments hook", :ruby => 1.9 do
162
+ before(:all) { Mail::Message.send(:include, Postmark::AttachmentsFixForMail) }
163
+
164
+ before do
165
+ mail_message.delivery_method Mail::Postmark
166
+ mail_message.should_receive(:remove_postmark_attachments_from_standard_fields)
167
+ Postmark.should_receive(:send_through_postmark).with(mail_message)
168
+ end
169
+
170
+ it "should run postmark attachments hook when using deliver! method" do
171
+ mail_message.deliver!
172
+ end
173
+
174
+ it "should run postmark attachments hook when using deliver method" do
175
+ mail_message.deliver
176
+ end
177
+
178
+
179
+ end
180
+
161
181
  context "JSON library support" do
162
182
  [:Json, :ActiveSupport, :Yajl].each do |lib|
163
183
  begin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11
4
+ version: 0.9.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ date: 2012-01-31 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
18
- requirement: &70183890117500 !ruby/object:Gem::Requirement
18
+ requirement: &70174637538220 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '0'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70183890117500
26
+ version_requirements: *70174637538220
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
- requirement: &70183890116520 !ruby/object:Gem::Requirement
29
+ requirement: &70174637537320 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70183890116520
37
+ version_requirements: *70174637537320
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: tmail
40
- requirement: &70183890115520 !ruby/object:Gem::Requirement
40
+ requirement: &70174637536120 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :development
47
47
  prerelease: false
48
- version_requirements: *70183890115520
48
+ version_requirements: *70174637536120
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: mail
51
- requirement: &70183890114000 !ruby/object:Gem::Requirement
51
+ requirement: &70174637534700 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '0'
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *70183890114000
59
+ version_requirements: *70174637534700
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: rspec-core
62
- requirement: &70183890113040 !ruby/object:Gem::Requirement
62
+ requirement: &70174637533620 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '2.0'
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *70183890113040
70
+ version_requirements: *70174637533620
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: activesupport
73
- requirement: &70183890111940 !ruby/object:Gem::Requirement
73
+ requirement: &70174637532520 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ~>
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '3.0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *70183890111940
81
+ version_requirements: *70174637532520
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: fakeweb
84
- requirement: &70183890110780 !ruby/object:Gem::Requirement
84
+ requirement: &70174637531520 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *70183890110780
92
+ version_requirements: *70174637531520
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: fakeweb-matcher
95
- requirement: &70183890109980 !ruby/object:Gem::Requirement
95
+ requirement: &70174637530680 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: '0'
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *70183890109980
103
+ version_requirements: *70174637530680
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: timecop
106
- requirement: &70183890109260 !ruby/object:Gem::Requirement
106
+ requirement: &70174637529940 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,10 +111,10 @@ dependencies:
111
111
  version: '0'
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *70183890109260
114
+ version_requirements: *70174637529940
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: yajl-ruby
117
- requirement: &70183890108540 !ruby/object:Gem::Requirement
117
+ requirement: &70174637529260 !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements:
120
120
  - - ! '>='
@@ -122,10 +122,10 @@ dependencies:
122
122
  version: '0'
123
123
  type: :development
124
124
  prerelease: false
125
- version_requirements: *70183890108540
125
+ version_requirements: *70174637529260
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: ruby-debug19
128
- requirement: &70183890107520 !ruby/object:Gem::Requirement
128
+ requirement: &70174637528420 !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ! '>='
@@ -133,7 +133,7 @@ dependencies:
133
133
  version: '0'
134
134
  type: :development
135
135
  prerelease: false
136
- version_requirements: *70183890107520
136
+ version_requirements: *70174637528420
137
137
  description: Use this gem to send emails through Postmark HTTP API and retrieve info
138
138
  about bounces.
139
139
  email: ilya@wildbit.com
@@ -190,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  segments:
192
192
  - 0
193
- hash: 840760196048598273
193
+ hash: 2238284457988379279
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  none: false
196
196
  requirements: