Class: Rwath::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/rwath/process.rb

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Process

Returns a new instance of Process.



3
4
5
# File 'lib/rwath/process.rb', line 3

def initialize(command)
  @command = command
end

Instance Method Details

#split_exec(text) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/rwath/process.rb', line 7

def split_exec(text)
  output = IO.popen(@command, "r+") {|io|
    io.puts text
    io.close_write
    io.gets
  }
  output.chomp
end