From: Pen Ttt on
IO.popen('gnuplot', 'w') { |io|
io.puts "plot sin(x)"
}
i tested ,it's ok
but i don't understand why is ('gnuplot', 'w'),why is not ('gnuplot',
'r'),
i call gunplot from ruby to get gnuplot's output ,so maybe it's
('gnuplot', 'r'),
when i use ('gnuplot', 'r'), can't get what i want,
could you tell me the reason of ('gnuplot', 'w')?

--
Posted via http://www.ruby-forum.com/.

From: Pen Ttt on
i don't know the difference of w and r.
program_a1:
f=IO.popen("gunzip -c ~/grid.zip","w")
while line=f.gets
print line
end
program_a2:
f=IO.popen("gunzip -c ~/grid.zip","r")
while line=f.gets
print line
end
program_a1 and program_a2 all can run ,what's the difference?

there is game--freeciv installed in my computer.
programb1:
File.popen("/usr/games/civ","w") do |pipe|
quote = pipe.gets
puts quote
end

programb2:
File.popen("/usr/games/civ","r") do |pipe|
quote = pipe.gets
puts quote
end
program_b1 and program_b2 all can run ,what's the difference?

--
Posted via http://www.ruby-forum.com/.

From: Joel VanderWerf on
Lars Haugseth wrote:
> The latest version of the gnuplot gem is 2.3.1, but I'm unable to find
> any documentation online (or even a homepage) that is even remotely up
> to date.

http://rgplot.rubyforge.org/

It look a little out of date, but maybe it helps?