Class: PVC::InputPiece::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/pvc/input_piece.rb

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Runner

Returns a new instance of Runner.



5
6
7
8
9
10
# File 'lib/pvc/input_piece.rb', line 5

def initialize(input)
  @input = input
  @read, @write = IO.pipe
  @read.close_on_exec = true
  @write.close_on_exec = true
end

Instance Method Details

#finishObject



21
22
23
24
# File 'lib/pvc/input_piece.rb', line 21

def finish
  @write.close
  @read.close
end

#start(following_piece) ⇒ Object



16
17
18
19
# File 'lib/pvc/input_piece.rb', line 16

def start(following_piece)
  following_piece.stdin.write(@input)
  following_piece.stdin.flush
end

#stdinObject



12
13
14
# File 'lib/pvc/input_piece.rb', line 12

def stdin
  @write
end