mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-06 07:10:10 +08:00
Clarify the Output type a little
This commit is contained in:
parent
2eca86268c
commit
f824135653
@ -182,9 +182,9 @@ module YouPlot
|
|||||||
|
|
||||||
def output_plot(plot)
|
def output_plot(plot)
|
||||||
case options[:output]
|
case options[:output]
|
||||||
when IO
|
when IO, StringIO
|
||||||
plot.render(options[:output])
|
plot.render(options[:output])
|
||||||
else
|
when String, Tempfile
|
||||||
File.open(options[:output], 'w') do |f|
|
File.open(options[:output], 'w') do |f|
|
||||||
plot.render(f)
|
plot.render(f)
|
||||||
end
|
end
|
||||||
@ -193,7 +193,7 @@ module YouPlot
|
|||||||
|
|
||||||
def output_plot_progressive(plot)
|
def output_plot_progressive(plot)
|
||||||
case options[:output]
|
case options[:output]
|
||||||
when IO
|
when IO, StringIO
|
||||||
# RefactorMe
|
# RefactorMe
|
||||||
out = StringIO.new(String.new)
|
out = StringIO.new(String.new)
|
||||||
def out.tty?
|
def out.tty?
|
||||||
|
@ -28,6 +28,7 @@ class YouPlotIRISTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
@stderr_file.close
|
@stderr_file.close
|
||||||
|
@stdout_file.close
|
||||||
end
|
end
|
||||||
|
|
||||||
def fixture(fname)
|
def fixture(fname)
|
||||||
|
@ -28,6 +28,7 @@ class YouPlotSimpleTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
@stderr_file.close
|
@stderr_file.close
|
||||||
|
@stdout_file.close
|
||||||
end
|
end
|
||||||
|
|
||||||
def fixture(fname)
|
def fixture(fname)
|
||||||
|
Loading…
Reference in New Issue
Block a user