lib/rash/redirection.rb
def with_stdout_as(file = STDOUT)
  $env.stdout = file
  if block_given?
    begin
      yield $stdout
    ensure
      $env.reset_stdout
    end
  end
end
# If you want to append, you need to get the file object yourself.
# Check if not flushing immediately is a concern. If so, set $stdout.sync for files
If you want to append, you need to get the file object yourself.
Check if not flushing immediately is a concern. If so, set $stdout.sync for files
If you want to append you need to get the file object yourself . Check if not flushing immediately is a concern . If so set $stdout . sync for files
def with_stdout_as(file = STDOUT)
  $env.stdout = file
  if block_given?
    begin
      yield $stdout
    ensure
      $env.reset_stdout
    end
  end
end
def with_stdout_as ( file = STDOUT ) $env . stdout = file if block_given? begin yield $stdout ensure $env . reset_stdout end end end
If you want to append, you need to get the file object yourself.
If you want to append you need to get the file object yourself .
file