class FunWith::Passwords::CommandLineResult

Attributes

args[R]
errors[R]
output[R]
success[R]

Public Class Methods

new( args ) click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 6
def initialize( args )
  @args = args
  @errors = []
  @output = ""
end

Public Instance Methods

fail!() click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 30
def fail!
  @success = false
end
failed?() click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 34
def failed?
  @success == false
end
puts( msg ) click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 22
def puts( msg )
  stdout( msg + "\n" )
end
puts_error( msg ) click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 26
def puts_error( msg )
  stderr( msg + "\n" )
end
stderr( msg ) click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 12
def stderr( msg )
  STDERR.puts( msg ) if @verbose
  @errors << msg
end
stdout( msg ) click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 17
def stdout( msg )
  STDOUT.write( msg ) if @verbose
  @output << msg
end
succeed!() click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 38
def succeed!
  @success = true
end
success?() click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 42
def success?
  @success
end
verbose( verbosity = nil ) click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 46
def verbose( verbosity = nil )
  @verbose = !!verbosity unless verbosity.nil?
  @verbose
end
verbose?() click to toggle source
# File lib/fun_with/passwords/command_line_result.rb, line 51
def verbose?
  
end