lib/lotus/loader.rb in lotusrb-0.4.1 vs lib/lotus/loader.rb in lotusrb-0.5.0

- old
+ new

@@ -51,11 +51,12 @@ def _configure_controller_framework! config = configuration unless namespace.const_defined?('Controller') controller = Lotus::Controller.duplicate(namespace) do handle_exceptions config.handle_exceptions - default_format config.default_format + default_request_format config.default_request_format + default_response_format config.default_response_format default_headers({ Lotus::Config::Security::X_FRAME_OPTIONS_HEADER => config.security.x_frame_options, Lotus::Config::Security::CONTENT_SECURITY_POLICY_HEADER => config.security.content_security_policy }) default_headers.merge!(STRICT_TRANSPORT_SECURITY_HEADER => STRICT_TRANSPORT_SECURITY_DEFAULT_VALUE) if config.force_ssl @@ -110,12 +111,14 @@ end end def _configure_logger! unless application_module.const_defined?('Logger', false) - logger = Lotus::Logger.new(application_module.to_s) - application_module.const_set('Logger', logger) + if configuration.logger.nil? + configuration.logger Lotus::Logger.new(application_module.to_s) + end + application_module.const_set('Logger', configuration.logger) end end def load_frameworks! _load_view_framework! @@ -143,9 +146,13 @@ end end def _lotus_model_loaded? defined?(Lotus::Model) + end + + def _lotus_mailer_loaded? + defined?(Lotus::Mailer) end def load_configuration_load_paths! configuration.load_paths.load!(configuration.root) end