Module: Rex::Ui::Subscriber::Output

Included in:
Rex::Ui::Subscriber
Defined in:
lib/rex/ui/subscriber.rb

Overview

Subscribes to the output half of the user interface.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#user_outputObject

The user output handle.



88
89
90
# File 'lib/rex/ui/subscriber.rb', line 88

def user_output
  @user_output
end

Instance Method Details

#flushObject

Wraps user_output.flush



81
82
83
# File 'lib/rex/ui/subscriber.rb', line 81

def flush
  user_output.flush if (user_output)
end

Wraps user_output.print



74
75
76
# File 'lib/rex/ui/subscriber.rb', line 74

def print(msg='')
  user_output.print(msg) if (user_output)
end

Prints a blank line. Used when the input is prompting.



95
96
97
98
# File 'lib/rex/ui/subscriber.rb', line 95

def print_blank_line
  user_output.prompting(false)
  user_output.print_line
end

Wraps user_output.print_error



42
43
44
45
46
47
# File 'lib/rex/ui/subscriber.rb', line 42

def print_error(msg='')
  if (user_output)
    print_blank_line if user_output.prompting?
    user_output.print_error(msg)
  end
end

Wraps user_output.print_good



54
55
56
57
58
59
# File 'lib/rex/ui/subscriber.rb', line 54

def print_good(msg='')
  if (user_output)
    print_blank_line if user_output.prompting?
    user_output.print_good(msg)
  end
end

Wraps user_output.print_line



22
23
24
25
26
27
# File 'lib/rex/ui/subscriber.rb', line 22

def print_line(msg='')
  if (user_output)
    print_blank_line if user_output.prompting?
    user_output.print_line(msg)
  end
end

Wraps user_output.print_status



32
33
34
35
36
37
# File 'lib/rex/ui/subscriber.rb', line 32

def print_status(msg='')
  if (user_output)
    print_blank_line if user_output.prompting?
    user_output.print_status(msg)
  end
end

Wraps user_output.print_warning



64
65
66
67
68
69
# File 'lib/rex/ui/subscriber.rb', line 64

def print_warning(msg='')
  if (user_output)
    print_blank_line if user_output.prompting?
    user_output.print_warning(msg)
  end
end