class Fission::UI

def initialize(stdout=$stdout)

Fission::UI.new str_io
str_io = StringIO.new

Fission::UI.new

Examples

an easy way to capture/silence output if needed.
stdout - The object to use for stdout (default: $stdout). This provides

Internal: Initialize a UI object.
def initialize(stdout=$stdout)
  @stdout = stdout
end

def output(s)

Returns nothing.

ui.output "foo bar\n"

Examples

s - The String to output.

The 'puts' method will be called on the stdout object.
Internal: Outputs the specified argument to the configured stdout object.
def output(s)
  @stdout.puts s
end

def output_and_exit(s, exit_code)

Returns nothing.

ui.output_and_exit 'all done', 0

ui.output_and_exit 'something went wrong', 99

Examples

exit_code - The Integer exit code.
s - The String to output.

and exits with the specified exit code.
Internal: Outputs the specified argument to the configured stdout object
def output_and_exit(s, exit_code)
  output s
  exit exit_code
end

def output_printf(string, key, value)

Returns nothing.

ui.output_printf "%s %s\n", 'foo', bar

Examples

value - The String for the second data item.
key - The String for the first data item.
string - The printf String.

are two data items.
method will be called on the stdout object. Currently, this assuems there
Internal: Outputs the specified arguments printf style. The 'printf'
def output_printf(string, key, value)
  @stdout.send :printf, string, key, value
end