actionmailer 5.0.0.beta2 → 5.0.0.beta3

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: c0d14afa14d6d0d4aa1c9c7c9122da27defea3a8
4
- data.tar.gz: caf53cbdc6f2b80b4028d953435f98b66ffbef67
3
+ metadata.gz: ba408a911beb5d1832f35eff868ab9940664b197
4
+ data.tar.gz: 2bb6c109b95010381c56d1fac22bd60dd8ab7c71
5
5
  SHA512:
6
- metadata.gz: 39069cfb3de1eb572efddcb75486c23b550e51954ea2dbdb7fe0d1304d7b80614dae428847f5b8c3543b9f24640b3bf6ea08fab2c8b83c472fea7112933709ba
7
- data.tar.gz: 71e349e536db6508fa95abfb9108b722985812cfb48183ad19074431166e2ce2021cff977ec9fb85ba6d1150ad86fff3d8e2e510829825861cd23300121ca239
6
+ metadata.gz: 5f6d5a01e6abe2f520204d6614e10c820a4dad08be9ea865eaebd916113ffd2decae7c82858e2cdfb4760e6e24d5b52bf0c7e500a5d9a651358b617cd33dbc04
7
+ data.tar.gz: 536373d714e7aebf11ee4ed1002fc48185030ef18daa1fe34e61db49ebc31f7069e10a1fc6b56af37bb613a4637d79fda379722168ee881c4ae8e1d368c430c6
@@ -1,3 +1,17 @@
1
+ ## Rails 5.0.0.beta3 (February 24, 2016) ##
2
+
3
+ * Add support to fragment cache in Action Mailer.
4
+
5
+ Now you can use fragment caching in your mailers views.
6
+
7
+ *Stan Lo*
8
+
9
+ * Reset `ActionMailer::Base.deliveries` after every test in
10
+ `ActionDispatch::IntegrationTest`.
11
+
12
+ *Yves Senn*
13
+
14
+
1
15
  ## Rails 5.0.0.beta2 (February 01, 2016) ##
2
16
 
3
17
  * No changes.
@@ -430,6 +430,7 @@ module ActionMailer
430
430
  include AbstractController::Translation
431
431
  include AbstractController::AssetPaths
432
432
  include AbstractController::Callbacks
433
+ include AbstractController::Caching
433
434
 
434
435
  include ActionView::Layouts
435
436
 
@@ -664,7 +665,7 @@ module ActionMailer
664
665
  #
665
666
  # You can also specify overrides if you want by passing a hash instead of a string:
666
667
  #
667
- # mail.attachments['filename.jpg'] = {mime_type: 'application/x-gzip',
668
+ # mail.attachments['filename.jpg'] = {mime_type: 'application/gzip',
668
669
  # content: File.read('/path/to/filename.jpg')}
669
670
  #
670
671
  # If you want to use encoding other than Base64 then you will need to pass encoding
@@ -672,7 +673,7 @@ module ActionMailer
672
673
  # data:
673
674
  #
674
675
  # file_content = SpecialEncode(File.read('/path/to/filename.jpg'))
675
- # mail.attachments['filename.jpg'] = {mime_type: 'application/x-gzip',
676
+ # mail.attachments['filename.jpg'] = {mime_type: 'application/gzip',
676
677
  # encoding: 'SpecialEncoding',
677
678
  # content: file_content }
678
679
  #
@@ -947,6 +948,18 @@ module ActionMailer
947
948
  container.add_part(part)
948
949
  end
949
950
 
951
+ # This and #instrument_name is for caching instrument
952
+ def instrument_payload(key)
953
+ {
954
+ mailer: mailer_name,
955
+ key: key
956
+ }
957
+ end
958
+
959
+ def instrument_name
960
+ "action_mailer"
961
+ end
962
+
950
963
  ActiveSupport.run_load_hooks(:action_mailer, self)
951
964
  end
952
965
  end
@@ -8,7 +8,7 @@ module ActionMailer
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
10
  TINY = 0
11
- PRE = "beta2"
11
+ PRE = "beta3"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -25,6 +25,7 @@ module ActionMailer
25
25
  options.javascripts_dir ||= paths["public/javascripts"].first
26
26
  options.stylesheets_dir ||= paths["public/stylesheets"].first
27
27
  options.show_previews = Rails.env.development? if options.show_previews.nil?
28
+ options.cache_store ||= Rails.cache
28
29
 
29
30
  if options.show_previews
30
31
  options.preview_path ||= defined?(Rails.root) ? "#{Rails.root}/test/mailers/previews" : nil
@@ -45,12 +46,7 @@ module ActionMailer
45
46
 
46
47
  options.each { |k,v| send("#{k}=", v) }
47
48
 
48
- if options.show_previews
49
- app.routes.prepend do
50
- get '/rails/mailers' => "rails/mailers#index"
51
- get '/rails/mailers/*path' => "rails/mailers#preview"
52
- end
53
- end
49
+ ActionDispatch::IntegrationTest.send :include, ActionMailer::TestCase::ClearTestDeliveries
54
50
  end
55
51
  end
56
52
 
@@ -60,9 +56,18 @@ module ActionMailer
60
56
  end
61
57
  end
62
58
 
63
- config.after_initialize do
64
- if ActionMailer::Base.preview_path
65
- ActiveSupport::Dependencies.autoload_paths << ActionMailer::Base.preview_path
59
+ config.after_initialize do |app|
60
+ options = app.config.action_mailer
61
+
62
+ if options.show_previews
63
+ app.routes.prepend do
64
+ get '/rails/mailers' => "rails/mailers#index", internal: true
65
+ get '/rails/mailers/*path' => "rails/mailers#preview", internal: true
66
+ end
67
+
68
+ if options.preview_path
69
+ ActiveSupport::Dependencies.autoload_paths << options.preview_path
70
+ end
66
71
  end
67
72
  end
68
73
  end
@@ -11,6 +11,21 @@ module ActionMailer
11
11
  end
12
12
 
13
13
  class TestCase < ActiveSupport::TestCase
14
+ module ClearTestDeliveries
15
+ extend ActiveSupport::Concern
16
+
17
+ included do
18
+ teardown :clear_test_deliviers
19
+ end
20
+
21
+ private
22
+ def clear_test_deliviers
23
+ if ActionMailer::Base.delivery_method == :test
24
+ ActionMailer::Base.deliveries.clear
25
+ end
26
+ end
27
+ end
28
+
14
29
  module Behavior
15
30
  extend ActiveSupport::Concern
16
31
 
@@ -66,7 +81,6 @@ module ActionMailer
66
81
  def restore_test_deliveries # :nodoc:
67
82
  restore_delivery_method
68
83
  ActionMailer::Base.perform_deliveries = @old_perform_deliveries
69
- ActionMailer::Base.deliveries.clear
70
84
  end
71
85
 
72
86
  def set_delivery_method(method) # :nodoc:
@@ -100,5 +114,6 @@ module ActionMailer
100
114
  end
101
115
 
102
116
  include Behavior
117
+ include ClearTestDeliveries
103
118
  end
104
119
  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: 5.0.0.beta2
4
+ version: 5.0.0.beta3
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: 2016-02-01 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0.beta2
19
+ version: 5.0.0.beta3
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: 5.0.0.beta2
26
+ version: 5.0.0.beta3
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: 5.0.0.beta2
33
+ version: 5.0.0.beta3
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: 5.0.0.beta2
40
+ version: 5.0.0.beta3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activejob
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 5.0.0.beta2
47
+ version: 5.0.0.beta3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 5.0.0.beta2
54
+ version: 5.0.0.beta3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mail
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -141,9 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - none
143
143
  rubyforge_project:
144
- rubygems_version: 2.5.2
144
+ rubygems_version: 2.5.1
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: Email composition, delivery, and receiving framework (part of Rails).
148
148
  test_files: []
149
- has_rdoc: