ryanb/letter_opener — pull request #89 by amatsuda (2014-02-18 10:32:44+00:00)
Title: Lazy-load ActionMailer::Base to defer :action_mailer on_load hook

Bundling current version of letter_opener immediately loads ActionMailer::Base when the gem is required, and thus triggers its whole initialization scripts (and then ActionMailer loads ActionView [here](https://github.com/rails/rails/blob/5d037819ca80606638212f83de741cc2041db28f/actionmailer/lib/action_mailer/base.rb#L415)) even in situations that ActionMailer or ActionView are not actually needed (e.g. booting up the Rails console, executing a model test, running a Rake task, etc.).

Here's a fix to lazy-load AM::Base via ActiveSupport.on_load hook so that AM::Base is loaded when actually referenced from the application.