diff --git a/bin/cli_helper.rb b/bin/cli_helper.rb index 6b41d5c7..27cffa8d 100644 --- a/bin/cli_helper.rb +++ b/bin/cli_helper.rb @@ -18,7 +18,7 @@ def setup @actions = @actions_wrapper # Automatic setting of console printing decorations - @loginator.decorate( !windows?() ) + @loginator.decorate = !windows?() end @@ -216,7 +216,7 @@ def process_decoration(env, config={}) decorate = true end - @loginator.decorate( decorate ) + @loginator.decorate = decorate end # Otherwise inspect project configuration (could be blank and gets skipped) @@ -224,9 +224,9 @@ def process_decoration(env, config={}) if (!walk[:value].nil?) case walk[:value] when :all - @loginator.decorate( true ) + @loginator.decorate = true when :none - @loginator.decorate( false ) + @loginator.decorate = false else #:auto # Retain what was set in `setup()` above based on platform end diff --git a/lib/ceedling/loginator.rb b/lib/ceedling/loginator.rb index 7f3f1660..328f1f4b 100644 --- a/lib/ceedling/loginator.rb +++ b/lib/ceedling/loginator.rb @@ -12,11 +12,12 @@ class Loginator attr_reader :project_logging + attr_writer :decorate constructor :verbosinator, :stream_wrapper, :file_wrapper, :system_wrapper def setup() - $decorate = false if $decorate.nil? + @decorate = false @replace = { # Problematic characters pattern => Simple characters @@ -90,15 +91,10 @@ def out(string, verbosity=Verbosity::NORMAL, label=LogLabels::AUTO, stream=nil) return if !(@verbosinator.should_output?( verbosity )) # Add labels and fun characters - console_str = format( string, verbosity, label, $decorate ) + console_str = format( string, verbosity, label, @decorate ) # Write to output stream after optionally removing any problematic characters - stream.print( sanitize( console_str, $decorate ) ) - end - - - def decorate(d) - $decorate = d + stream.print( sanitize( console_str, @decorate ) ) end ### Private ###