actionmailer 4.1.11 → 4.1.12.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: 2e6fd941b2ff67ad1fe2b1f670424ff7f9081134
4
- data.tar.gz: 09dd5d871c8471413c6c1109cad4e79c48e6ea9b
3
+ metadata.gz: e024105b8752861f2d87e2aa0e463696f57d7382
4
+ data.tar.gz: cc9209a06c0b79c7a17d130823cacbc5909f9213
5
5
  SHA512:
6
- metadata.gz: b5a3d8cd8e5cb995fa7c31b85ed7d62e790d834de248ef750e0c6d81e75ffc0daba1baf947109ed51db2cb006207e5ed166ef9d6cba19fc17cdbef80161d5e03
7
- data.tar.gz: fd16829c63b0261c5c18554652905c6de4ee415534696f3989a8f98b081ef12e950cfbf06754f1865c71cd6b9b98042c52ec5a5485e9b88ac236ddc1fef71e77
6
+ metadata.gz: 642b24fcb08493533d566d97fb890c89ddb8c4bbaecc5dd6492824472fcfa05ccd5069f0b355a699a1c4da8dc6bb0bb6bf6dfdb8f77b109f35cb05c2b91230c9
7
+ data.tar.gz: e561a910d0d51c68a4ec1eaeb57e04eb273bd5fbf12c1e72350cb6c01a629f7e08c6bcca24cdb5c74c57a8456cd40595b2ff0c73183eb28457699eff5428e8d0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## Rails 4.1.12 (June 22, 2015) ##
2
+
3
+ * Mailer preview now uses `url_for` to fix links to emails for apps running on
4
+ a subdirectory.
5
+
6
+ *Remo Mueller*
7
+
8
+ * Mailer previews no longer crash when the `mail` method wasn't called
9
+ (`NullMail`).
10
+
11
+ Fixes #19849.
12
+
13
+ *Yves Senn*
14
+
15
+ * Make sure labels and values line up in mailer previews.
16
+
17
+ *Yves Senn*
18
+
19
+
1
20
  ## Rails 4.1.11 (June 16, 2015) ##
2
21
 
3
22
  * No changes.
data/lib/action_mailer.rb CHANGED
@@ -40,6 +40,7 @@ module ActionMailer
40
40
 
41
41
  autoload :Base
42
42
  autoload :DeliveryMethods
43
+ autoload :InlinePreviewInterceptor
43
44
  autoload :MailHelper
44
45
  autoload :Preview
45
46
  autoload :Previews, 'action_mailer/preview'
@@ -584,6 +584,7 @@ module ActionMailer
584
584
 
585
585
  class NullMail #:nodoc:
586
586
  def body; '' end
587
+ def header; {} end
587
588
 
588
589
  def method_missing(*args)
589
590
  nil
@@ -7,8 +7,8 @@ module ActionMailer
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 1
10
- TINY = 11
11
- PRE = nil
10
+ TINY = 12
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -0,0 +1,61 @@
1
+ require 'base64'
2
+
3
+ module ActionMailer
4
+ # Implements a mailer preview interceptor that converts image tag src attributes
5
+ # that use inline cid: style urls to data: style urls so that they are visible
6
+ # when previewing a HTML email in a web browser.
7
+ #
8
+ # This interceptor is not enabled by default, to use it just register it like any
9
+ # other mailer preview interceptor:
10
+ #
11
+ # ActionMailer::Base.register_preview_interceptor(ActionMailer::InlinePreviewInterceptor)
12
+ #
13
+ class InlinePreviewInterceptor
14
+ PATTERN = /src=(?:"cid:[^"]+"|'cid:[^']+')/i
15
+
16
+ include Base64
17
+
18
+ def self.previewing_email(message) #:nodoc:
19
+ new(message).transform!
20
+ end
21
+
22
+ def initialize(message) #:nodoc:
23
+ @message = message
24
+ end
25
+
26
+ def transform! #:nodoc:
27
+ return message if html_part.blank?
28
+
29
+ html_source.gsub!(PATTERN) do |match|
30
+ if part = find_part(match[9..-2])
31
+ %[src="#{data_url(part)}"]
32
+ else
33
+ match
34
+ end
35
+ end
36
+
37
+ message
38
+ end
39
+
40
+ private
41
+ def message
42
+ @message
43
+ end
44
+
45
+ def html_part
46
+ @html_part ||= message.html_part
47
+ end
48
+
49
+ def html_source
50
+ html_part.body.raw_source
51
+ end
52
+
53
+ def data_url(part)
54
+ "data:#{part.mime_type};base64,#{strict_encode64(part.body.raw_source)}"
55
+ end
56
+
57
+ def find_part(cid)
58
+ message.all_parts.find{ |p| p.attachment? && p.cid == cid }
59
+ end
60
+ end
61
+ end
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.11
4
+ version: 4.1.12.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: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.11
19
+ version: 4.1.12.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.11
26
+ version: 4.1.12.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.11
33
+ version: 4.1.12.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.11
40
+ version: 4.1.12.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mail
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +73,7 @@ files:
73
73
  - lib/action_mailer/collector.rb
74
74
  - lib/action_mailer/delivery_methods.rb
75
75
  - lib/action_mailer/gem_version.rb
76
+ - lib/action_mailer/inline_preview_interceptor.rb
76
77
  - lib/action_mailer/log_subscriber.rb
77
78
  - lib/action_mailer/mail_helper.rb
78
79
  - lib/action_mailer/preview.rb
@@ -98,9 +99,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
99
  version: 1.9.3
99
100
  required_rubygems_version: !ruby/object:Gem::Requirement
100
101
  requirements:
101
- - - ">="
102
+ - - ">"
102
103
  - !ruby/object:Gem::Version
103
- version: '0'
104
+ version: 1.3.1
104
105
  requirements:
105
106
  - none
106
107
  rubyforge_project: