lib/hanami/configuration.rb in hanami-0.7.3 vs lib/hanami/configuration.rb in hanami-0.8.0
- old
+ new
@@ -1,16 +1,17 @@
require 'hanami/utils/kernel'
require 'hanami/utils/deprecation'
require 'hanami/environment'
+require 'hanami/config/configure'
+require 'hanami/config/cookies'
require 'hanami/config/framework_configuration'
require 'hanami/config/load_paths'
-require 'hanami/config/routes'
+require 'hanami/config/logger'
require 'hanami/config/mapping'
-require 'hanami/config/sessions'
-require 'hanami/config/configure'
+require 'hanami/config/routes'
require 'hanami/config/security'
-require 'hanami/config/cookies'
+require 'hanami/config/sessions'
module Hanami
# Configuration for a Hanami application
#
# @since 0.1.0
@@ -378,11 +379,11 @@
# The application will serve the static assets under these directories.
#
# By default it's equal to the `public/` directory under the application
# `root`.
#
- # Otherwise, you can add differents relatives paths under `root`.
+ # Otherwise, you can add different relatives paths under `root`.
#
# @overload assets
# Gets the value
# @return [Hanami::Config::Assets] assets root
#
@@ -528,11 +529,11 @@
# end
#
# Bookshelf::Application.configuration.sessions
# # => #<Hanami::Config::Sessions:0x00000001589458 @enabled=true, @adapter=:cookie, @options={:domain=>"localhost", :secure=>false}>
#
- # @example Disabling previusly enabled sessions
+ # @example Disabling previously enabled sessions
# require 'hanami'
#
# module Bookshelf
# class Application < Hanami::Application
# configure do
@@ -1292,11 +1293,11 @@
# end
# end
#
# module DashboardController
# class Index
- # incude Bookshelf::Action
+ # include Bookshelf::Action
#
# def call(params)
# end
# end
# end
@@ -1655,27 +1656,25 @@
# # It will use `:backend` layout
def view
@view ||= Config::FrameworkConfiguration.new
end
- # Defines a logger instance to the configuration
+ # Defines a Config::Logger instance to the logger configuration.
#
- # This logger instance will be used to set the logger available on application module
+ # This instance will be used to generate the hanami logger available on application module.
#
- # If no logger instance is defined, a Hanami::Logger will be set by default
+ # @return [Config::Logger] Configure logger instance
#
- # @return [Logger, NilClass] logger instance
- #
# @since 0.5.0
#
# @example Define a logger
# require 'hanami'
#
# module Bookshelf
# class Application < Hanami::Application
# configure do
- # logger Logger.new(STDOUT)
+ # logger.stream 'path/to/log/file'
# end
# load!
# end
#
# module Controllers::Error
@@ -1687,15 +1686,11 @@
# end
# end
# end
# end
#
- def logger(value = nil)
- if value.nil?
- @logger
- else
- @logger = value
- end
+ def logger
+ @logger ||= Config::Logger.new
end
# This options is used as a bridge between container and router application.
#
# @return [String, NilClass] path prefix for routes