lib/guard/ui.rb in guard-2.10.5 vs lib/guard/ui.rb in guard-2.11.0
- old
+ new
@@ -1,9 +1,14 @@
require "guard/ui/colors"
require "guard/terminal"
+require "guard/options"
+# TODO: rework this class from the bottom-up
+# - remove dependency on Session and Scope
+# - extract into a separate gem
+
module Guard
# The UI class helps to format messages for the user. Everything that is
# logged through this class is considered either as an error message or a
# diagnostic message and is written to standard error ($stderr).
#
@@ -35,11 +40,11 @@
# Get the logger options
#
# @return [Hash] the logger options
#
def options
- @options ||= ::Guard::Options.new(
+ @options ||= Options.new(
level: :info,
template: ":time - :severity - :message",
time_format: "%H:%M:%S")
end
@@ -50,10 +55,10 @@
# @option options [String] template the logger template
# @option options [String] time_format the time format
#
# TODO: deprecate?
def options=(options)
- @options = ::Guard::Options.new(options)
+ @options = Options.new(options)
end
# Assigns a log level
def level=(new_level)
logger.level = new_level