lib/hanami/model/configurator.rb in hanami-model-0.7.0 vs lib/hanami/model/configurator.rb in hanami-model-1.0.0.beta1
- old
+ new
@@ -23,16 +23,31 @@
# @since 0.7.0
# @api private
attr_reader :_schema
+ # @since 1.0.0.beta1
+ # @api private
+ attr_reader :_logger
+
+ # @since 1.0.0.beta1
+ # @api private
+ attr_reader :_gateway
+
# @since 0.7.0
# @api private
def self.build(&block)
new.tap { |config| config.instance_eval(&block) }
end
+ # @since 1.0.0.beta1
+ # @api private
+ def migrations_logger(stream = $stdout)
+ require 'hanami/model/migrator/logger'
+ @migrations_logger ||= Hanami::Model::Migrator::Logger.new(stream)
+ end
+
private
# @since 0.7.0
# @api private
def adapter(backend, url)
@@ -54,9 +69,24 @@
# @since 0.7.0
# @api private
def schema(path)
@_schema = path
+ end
+
+ # @since 1.0.0.beta1
+ # @api private
+ def logger(stream, options = {})
+ require 'hanami/logger'
+
+ opts = options.merge(stream: stream)
+ @_logger = Hanami::Logger.new('hanami.model', opts)
+ end
+
+ # @since 1.0.0.beta1
+ # @api private
+ def gateway(&blk)
+ @_gateway = blk
end
end
end
end