mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-05 22:31:11 +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)
|
||||
case options[:output]
|
||||
when IO
|
||||
when IO, StringIO
|
||||
plot.render(options[:output])
|
||||
else
|
||||
when String, Tempfile
|
||||
File.open(options[:output], 'w') do |f|
|
||||
plot.render(f)
|
||||
end
|
||||
@ -193,7 +193,7 @@ module YouPlot
|
||||
|
||||
def output_plot_progressive(plot)
|
||||
case options[:output]
|
||||
when IO
|
||||
when IO, StringIO
|
||||
# RefactorMe
|
||||
out = StringIO.new(String.new)
|
||||
def out.tty?
|
||||
|
@ -28,6 +28,7 @@ class YouPlotIRISTest < Test::Unit::TestCase
|
||||
|
||||
def teardown
|
||||
@stderr_file.close
|
||||
@stdout_file.close
|
||||
end
|
||||
|
||||
def fixture(fname)
|
||||
|
@ -28,6 +28,7 @@ class YouPlotSimpleTest < Test::Unit::TestCase
|
||||
|
||||
def teardown
|
||||
@stderr_file.close
|
||||
@stdout_file.close
|
||||
end
|
||||
|
||||
def fixture(fname)
|
||||
|
Loading…
Reference in New Issue
Block a user