From 1b525f13351f9d540a44d5bbc876f17edf11ad57 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Mon, 21 Dec 2020 21:42:32 +0900 Subject: [PATCH] Support headers in progressive mode --- lib/youplot/command.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/youplot/command.rb b/lib/youplot/command.rb index 3f68516..1667b11 100644 --- a/lib/youplot/command.rb +++ b/lib/youplot/command.rb @@ -63,7 +63,16 @@ module YouPlot def main_progressive(input) output_data(input) - @raw_data ||= String.new + # FIXME + # Worked around the problem of not being able to draw + # plots when there is only one header line. + if @raw_data.nil? + @raw_data = String.new + if options[:headers] + @raw_data << input + return + end + end @raw_data << input # FIXME