lib/banana/logger.rb
# Calls the block after changing the output method to `:print`.
# It also ensures to set back the method to what it was before.
#
# @param [Boolean] clear If set to true and any message was printed inside the block
#   a \n newline character will be printed.
Calls the block after changing the output method to `:print`.
It also ensures to set back the method to what it was before.
Calls the block after changing the output method to ` : print ` . It also ensures to set back the method to what it was before .
def log_with_print clear = true, &block
      ensure_method :print do
        begin
          block.call
        ensure
          raw(nil, :puts) if clear && @logged > 0
        end
      end
    end
def log_with_print clear = true , & block ensure_method :print do begin block . call ensure raw ( nil , :puts ) if clear && @logged > 0 end end end
Calls the block after changing the output method to `:print`.
Calls the block after changing the output method to ` : print ` .
clear
<not_specific>
block
<not_specific>
<not_specific>
clear If set to true and any message was printed inside the block a \n newline character will be printed.
clear If set to true and any message was printed inside the block a \ n newline character will be printed .