lib/hanami.rb in hanami-0.9.2 vs lib/hanami.rb in hanami-1.0.0.beta1
- old
+ new
@@ -50,11 +50,11 @@
# root "lib/bookshelf/mailers"
#
# delivery do
# development :test
# test :test
- # # production :smtp, address: ENV['SMTP_HOST'], port: 1025
+ # # production :smtp, address: ENV['SMTP_HOST'], port: ENV['SMTP_PORT']
# end
# end
# end
def self.configure(&blk)
@_mutex.synchronize do
@@ -88,10 +88,11 @@
# NOTE: This MUST NOT be wrapped by a Mutex, because it would cause a deadlock.
#
# @since 0.9.0
# @api private
def self.boot
+ Components.release if code_reloading?
Components.resolve('all')
end
# Main application that mounts many Rack and/or Hanami applications.
#
@@ -192,7 +193,30 @@
# @since 0.3.2
def self.environment
Components.resolved('environment') do
Environment.new
end
+ end
+
+ # Check if code reloading is enabled.
+ #
+ # @return [TrueClass,FalseClass] the result of the check
+ #
+ # @since 1.0.0.beta1
+ # @api private
+ #
+ # @see http://hanamirb.org/guides/projects/code-reloading/
+ def self.code_reloading?
+ environment
+ Components.resolve('code_reloading')
+ Components['code_reloading']
+ end
+
+ # Project logger
+ #
+ # @return [Hanami::Logger] the logger
+ #
+ # @since 1.0.0.beta1
+ def self.logger
+ Components['logger']
end
end