actionmailer 4.1.5 → 4.1.6.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionmailer might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bc2a0b8cae158bad3e18aa34ccc1dd4805ed758
4
- data.tar.gz: 70f586cd1089ee17b6a9da9a1f46cf2e7fb615b5
3
+ metadata.gz: 8085e6053a70191ca1357e214508c6ddef97fea7
4
+ data.tar.gz: 62cd59b6c064d2ad2d3d245cdc56f27b8cf303dc
5
5
  SHA512:
6
- metadata.gz: 5a33f52174be73da93bca45e52d28cb60c325da27a5146213ed841c9c88e9cc7f8cef8afe4c6e285140a894223013da55efdc4345ba8d4825f3aeff4b591f55d
7
- data.tar.gz: fdea28a7f64adf263e69c3573f67956072471aa423a70bb13e5a25542584b475ed710fd677f825422d6880284fb9ea4b5b92505392cfcad6f4b5045168dfcebc
6
+ metadata.gz: bf7543476acd0aa5d08027e821709b04d221a763b011bfb80821078f79f6cb10047ef8b305df868e7f1b00035c302fd3902649c5754e9b783d7e0cffc41ffcd0
7
+ data.tar.gz: 47d59442f5223d7eb35b3a8b2ba47f23515e6643df9ad5ca418f0383826679ff6ceb122ca0756a2aaf9d88979f69230b1f44477d83d73a5722cd2b711fdf36e4
@@ -1,3 +1,26 @@
1
+ ## Rails 4.1.6 (August 19, 2014) ##
2
+
3
+ * Make ActionMailer::Previews methods class methods. Previously they were
4
+ instance methods and ActionMailer tries to render a message when they
5
+ are called.
6
+
7
+ *Cristian Bica*
8
+
9
+ * Raise an exception when attachments are added after `mail` was called.
10
+ This is a safeguard to prevent invalid emails.
11
+
12
+ Fixes #16163.
13
+
14
+ *Yves Senn*
15
+
16
+ * Allow preview interceptors to be registered through
17
+ `config.action_mailer.preview_interceptors`.
18
+
19
+ See #15739.
20
+
21
+ *Yves Senn*
22
+
23
+
1
24
  ## Rails 4.1.5 (August 18, 2014) ##
2
25
 
3
26
  * No changes.
@@ -339,7 +339,7 @@ module ActionMailer
339
339
  # end
340
340
  # end
341
341
  #
342
- # config.action_mailer.register_preview_interceptor :css_inline_styler
342
+ # config.action_mailer.preview_interceptors :css_inline_styler
343
343
  #
344
344
  # Note that interceptors need to be registered both with <tt>register_interceptor</tt>
345
345
  # and <tt>register_preview_interceptor</tt> if they should operate on both sending and
@@ -648,7 +648,22 @@ module ActionMailer
648
648
  # mail.attachments[0] # => Mail::Part (first attachment)
649
649
  #
650
650
  def attachments
651
- @_message.attachments
651
+ if @_mail_was_called
652
+ LateAttachmentsProxy.new(@_message.attachments)
653
+ else
654
+ @_message.attachments
655
+ end
656
+ end
657
+
658
+ class LateAttachmentsProxy < SimpleDelegator
659
+ def inline; _raise_error end
660
+ def []=(_name, _content); _raise_error end
661
+
662
+ private
663
+ def _raise_error
664
+ raise RuntimeError, "Can't add attachments after `mail` was called.\n" \
665
+ "Make sure to use `attachments[]=` before calling `mail`."
666
+ end
652
667
  end
653
668
 
654
669
  # The main method that creates the message and renders the email templates. There are
@@ -7,8 +7,8 @@ module ActionMailer
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 1
10
- TINY = 5
11
- PRE = nil
10
+ TINY = 6
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -14,7 +14,9 @@ module ActionMailer
14
14
  # :nodoc:
15
15
  mattr_accessor :preview_interceptors, instance_writer: false
16
16
  self.preview_interceptors = []
17
+ end
17
18
 
19
+ module ClassMethods
18
20
  # Register one or more Interceptors which will be called before mail is previewed.
19
21
  def register_preview_interceptors(*interceptors)
20
22
  interceptors.flatten.compact.each { |interceptor| register_preview_interceptor(interceptor) }
@@ -33,6 +33,7 @@ module ActionMailer
33
33
  include app.routes.mounted_helpers
34
34
 
35
35
  register_interceptors(options.delete(:interceptors))
36
+ register_preview_interceptors(options.delete(:preview_interceptors))
36
37
  register_observers(options.delete(:observers))
37
38
 
38
39
  options.each { |k,v| send("#{k}=", v) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionmailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.5
4
+ version: 4.1.6.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2014-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -16,33 +16,36 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.5
19
+ version: 4.1.6.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.5
26
+ version: 4.1.6.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionview
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.5
33
+ version: 4.1.6.rc1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.1.5
40
+ version: 4.1.6.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mail
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.5'
48
+ - - ">="
46
49
  - !ruby/object:Gem::Version
47
50
  version: 2.5.4
48
51
  type: :runtime
@@ -50,6 +53,9 @@ dependencies:
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '2.5'
58
+ - - ">="
53
59
  - !ruby/object:Gem::Version
54
60
  version: 2.5.4
55
61
  description: Email on Rails. Compose, deliver, receive, and test emails using the
@@ -92,9 +98,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
98
  version: 1.9.3
93
99
  required_rubygems_version: !ruby/object:Gem::Requirement
94
100
  requirements:
95
- - - ">="
101
+ - - ">"
96
102
  - !ruby/object:Gem::Version
97
- version: '0'
103
+ version: 1.3.1
98
104
  requirements:
99
105
  - none
100
106
  rubyforge_project: