diff --git a/CHANGELOG.md b/CHANGELOG.md index b57003d..e744a8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.3.0 + +- Delay loading of ActionMailer to fix support for `delivery_job` config (https://github.com/codetriage/maildown/pull/56) + ## 3.2.0 - Switch to "github style markdown" (https://github.com/codetriage/maildown/pull/54) diff --git a/gemfiles/rails_5.gemfile.lock b/gemfiles/rails_5.gemfile.lock index 769ab56..1c1d932 100644 --- a/gemfiles/rails_5.gemfile.lock +++ b/gemfiles/rails_5.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - maildown (3.1.0) + maildown (3.2.0) actionmailer (>= 4.0.0) kramdown-parser-gfm @@ -58,7 +58,7 @@ GEM activesupport (>= 4.2.0) i18n (1.6.0) concurrent-ruby (~> 1.0) - kramdown (2.2.1) + kramdown (2.3.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) diff --git a/gemfiles/rails_51.gemfile.lock b/gemfiles/rails_51.gemfile.lock index cdab2d4..068b86b 100644 --- a/gemfiles/rails_51.gemfile.lock +++ b/gemfiles/rails_51.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - maildown (3.1.0) + maildown (3.2.0) actionmailer (>= 4.0.0) kramdown-parser-gfm @@ -58,7 +58,7 @@ GEM activesupport (>= 4.2.0) i18n (1.6.0) concurrent-ruby (~> 1.0) - kramdown (2.2.1) + kramdown (2.3.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) diff --git a/gemfiles/rails_52.gemfile.lock b/gemfiles/rails_52.gemfile.lock index fe4653a..c3f51a7 100644 --- a/gemfiles/rails_52.gemfile.lock +++ b/gemfiles/rails_52.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - maildown (3.1.0) + maildown (3.2.0) actionmailer (>= 4.0.0) kramdown-parser-gfm @@ -62,7 +62,7 @@ GEM activesupport (>= 4.2.0) i18n (1.6.0) concurrent-ruby (~> 1.0) - kramdown (2.2.1) + kramdown (2.3.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index 7db9a46..b5a73f4 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - maildown (3.1.0) + maildown (3.2.0) actionmailer (>= 4.0.0) kramdown-parser-gfm @@ -75,7 +75,7 @@ GEM activesupport (>= 4.2.0) i18n (1.6.0) concurrent-ruby (~> 1.0) - kramdown (2.2.1) + kramdown (2.3.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) diff --git a/gemfiles/rails_head.gemfile.lock b/gemfiles/rails_head.gemfile.lock index d757c98..9bc5387 100644 --- a/gemfiles/rails_head.gemfile.lock +++ b/gemfiles/rails_head.gemfile.lock @@ -82,7 +82,7 @@ GIT PATH remote: .. specs: - maildown (3.1.0) + maildown (3.2.0) actionmailer (>= 4.0.0) kramdown-parser-gfm @@ -101,7 +101,7 @@ GEM activesupport (>= 4.2.0) i18n (1.6.0) concurrent-ruby (~> 1.0) - kramdown (2.2.1) + kramdown (2.3.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) diff --git a/lib/maildown.rb b/lib/maildown.rb index f566461..e103058 100644 --- a/lib/maildown.rb +++ b/lib/maildown.rb @@ -17,6 +17,10 @@ def self.rails_6? end require 'maildown/markdown_engine' -require 'maildown/ext/action_mailer' -require 'maildown/ext/action_view' +ActiveSupport.on_load(:action_mailer) do + require 'maildown/ext/action_mailer' +end +ActiveSupport.on_load(:action_view) do + require 'maildown/ext/action_view' +end require 'maildown/handlers/markdown' diff --git a/lib/maildown/ext/action_mailer.rb b/lib/maildown/ext/action_mailer.rb index 5a73cd1..cae3132 100644 --- a/lib/maildown/ext/action_mailer.rb +++ b/lib/maildown/ext/action_mailer.rb @@ -1,8 +1,5 @@ # frozen_string_literal: true -require 'action_mailer' -require 'action_mailer/base' - # Monkeypatch to allow mailer to auto generate text/html # # If you generate a mailer action, by default it will only diff --git a/lib/maildown/ext/action_view.rb b/lib/maildown/ext/action_view.rb index ccf65c9..9d680ee 100644 --- a/lib/maildown/ext/action_view.rb +++ b/lib/maildown/ext/action_view.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'action_view' - # This monkeypatch allows the use of `.md.erb` file extensions # in addition to `.md+erb` and `.md` module ActionView