From 19c3b0367a6a840c891273c7f9bfeaccd7d8d0a1 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Sun, 15 Nov 2020 00:43:00 +0900 Subject: [PATCH] Rubocop auto correct --- lib/uplot/command/parser.rb | 2 +- lib/uplot/plot.rb | 2 +- lib/uplot/preprocessing.rb | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/uplot/command/parser.rb b/lib/uplot/command/parser.rb index 09834de..41d235c 100644 --- a/lib/uplot/command/parser.rb +++ b/lib/uplot/command/parser.rb @@ -148,7 +148,7 @@ module Uplot MSG case command - + # If you type only `uplot` in the terminal. when nil warn main_parser.banner diff --git a/lib/uplot/plot.rb b/lib/uplot/plot.rb index 3c67c56..fa30ef2 100644 --- a/lib/uplot/plot.rb +++ b/lib/uplot/plot.rb @@ -18,7 +18,7 @@ module Uplot if series.size == 1 # If there is only one series, use the line number for label. params.title ||= headers[0] if headers - labels = Array.new(series[0].size){|i| (i+1).to_s} + labels = Array.new(series[0].size) { |i| (i + 1).to_s } values = series[0].map(&:to_f) else params.title ||= headers[1] if headers diff --git a/lib/uplot/preprocessing.rb b/lib/uplot/preprocessing.rb index f213e8c..10ee88f 100644 --- a/lib/uplot/preprocessing.rb +++ b/lib/uplot/preprocessing.rb @@ -62,12 +62,10 @@ module Uplot else arr end + elsif headers + transpose2(arr[1..-1]) else - if headers - transpose2(arr[1..-1]) - else - transpose2(arr) - end + transpose2(arr) end end