Add raw_input variable

This commit is contained in:
kojix2 2020-08-15 19:41:53 +09:00
parent 1548675967
commit 22460f3689

View File

@ -30,6 +30,7 @@ module Uplot
end end
attr_accessor :params, :plot_type attr_accessor :params, :plot_type
attr_reader :raw_inputs
def initialize(argv) def initialize(argv)
@params = Params.new @params = Params.new
@ -41,7 +42,10 @@ module Uplot
@output = false @output = false
@count = false @count = false
@fmt = 'xyy' @fmt = 'xyy'
@raw_inputs = []
@debug = false @debug = false
parse_options(argv) parse_options(argv)
end end
@ -235,6 +239,7 @@ module Uplot
# Sometimes the input file does not end with a newline code. # Sometimes the input file does not end with a newline code.
while input = Kernel.gets(nil) while input = Kernel.gets(nil)
input.freeze input.freeze
@raw_inputs << input
data, headers = preprocess(input) data, headers = preprocess(input)
pp input: input, data: data, headers: headers if @debug pp input: input, data: data, headers: headers if @debug
case plot_type case plot_type