lib/roda/plugins/mailer.rb in roda-2.28.0 vs lib/roda/plugins/mailer.rb in roda-2.29.0
- old
+ new
@@ -109,11 +109,11 @@
# separate Roda application for emails. This can be a subclass of your main
# Roda application if you want your helper methods to automatically be
# available in your email views.
module Mailer
OPTS = {}.freeze
-
+ RodaPlugins.deprecate_constant(self, :OPTS)
REQUEST_METHOD = "REQUEST_METHOD".freeze
RodaPlugins.deprecate_constant(self, :REQUEST_METHOD)
PATH_INFO = "PATH_INFO".freeze
RodaPlugins.deprecate_constant(self, :PATH_INFO)
SCRIPT_NAME = 'SCRIPT_NAME'.freeze
@@ -137,11 +137,11 @@
# tree doesn't return the mail object.
class Error < ::Roda::RodaError; end
# Set the options for the mailer. Options:
# :content_type :: The default content type for emails (default: text/plain)
- def self.configure(app, opts=OPTS)
- app.opts[:mailer] = (app.opts[:mailer]||{}).merge(opts).freeze
+ def self.configure(app, opts=RodaPlugins::OPTS)
+ app.opts[:mailer] = (app.opts[:mailer]||RodaPlugins::OPTS).merge(opts).freeze
end
module ClassMethods
# Return a Mail::Message instance for the email for the given request path
# and arguments. You can further manipulate the returned mail object before