lib/roda/plugins/error_mail.rb in roda-2.28.0 vs lib/roda/plugins/error_mail.rb in roda-2.29.0

- old
+ new

@@ -35,13 +35,14 @@ # Note that emailing on every error as shown above is only appropriate # for low traffic web applications. For high traffic web applications, # use an error reporting service instead of this plugin. module ErrorMail OPTS = {}.freeze + RodaPlugins.deprecate_constant(self, :OPTS) # Set default opts for plugin. See ErrorEmail module RDoc for options. - def self.configure(app, opts=OPTS) - app.opts[:error_mail] = email_opts = (app.opts[:error_mail] || OPTS).merge(opts).freeze + def self.configure(app, opts=RodaPlugins::OPTS) + app.opts[:error_mail] = email_opts = (app.opts[:error_mail] || RodaPlugins::OPTS).merge(opts).freeze unless email_opts[:to] && email_opts[:from] raise RodaError, "must provide :to and :from options to error_mail plugin" end end