Module: Hijack::Console::OutputReceiver

Defined in:
lib/hijack/console.rb

Class Method Summary collapse

Class Method Details

.muteObject



44
45
46
# File 'lib/hijack/console.rb', line 44

def mute
  @mute = true
end

.puts(where, str) ⇒ Object



57
58
59
# File 'lib/hijack/console.rb', line 57

def puts(where, str)
  Object.const_get(where.upcase).puts(str) unless @mute
end

.start(remote) ⇒ Object



61
62
63
64
65
# File 'lib/hijack/console.rb', line 61

def start(remote)
  DRb.start_service(Hijack.socket_for(Process.pid), self)
  remote.evaluate("__hijack_output_receiver_ready_#{Process.pid}")
  @started = true
end

.unmute(remote) ⇒ Object



48
49
50
51
# File 'lib/hijack/console.rb', line 48

def unmute(remote)
  start(remote) unless @started
  @mute = false
end

.write(where, str) ⇒ Object



53
54
55
# File 'lib/hijack/console.rb', line 53

def write(where, str)
  Object.const_get(where.upcase).write(str) unless @mute
end