lib/nanoc/cli/logger.rb in nanoc-3.6.7 vs lib/nanoc/cli/logger.rb in nanoc-3.6.8

- old
+ new

@@ -11,12 +11,12 @@ # Maps actions (`:create`, `:update`, `:identical`, `:skip` and `:delete`) # onto their ANSI color codes. ACTION_COLORS = { :create => "\e[32m", # green :update => "\e[33m", # yellow - :identical => "", # (nothing) - :skip => "", # (nothing) + :identical => '', # (nothing) + :skip => '', # (nothing) :delete => "\e[31m" # red } include Singleton @@ -38,18 +38,18 @@ # @param [:create, :update, :identical, :skip, :delete] action The kind of file action # # @param [String] name The name of the file the action was performed on # # @return [void] - def file(level, action, name, duration=nil) + def file(level, action, name, duration = nil) log( level, '%s%12s%s %s%s' % [ ACTION_COLORS[action.to_sym], action, "\e[0m", - duration.nil? ? '' : "[%2.2fs] " % [ duration ], + duration.nil? ? '' : '[%2.2fs] ' % [ duration ], name ] ) end @@ -60,15 +60,15 @@ # @param [String] message The message to be logged # # @param [#puts] io The stream to which the message should be written # # @return [void] - def log(level, message, io=$stdout) + def log(level, message, io = $stdout) # Don't log when logging is disabled return if @level == :off # Log when level permits it - io.puts(message) if (@level == :low or @level == level) + io.puts(message) if @level == :low || @level == level end end end