From d9777435a48ef0e0bff0bf28d8ea7ef962042d11 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 3 Jun 2021 10:38:09 +0900 Subject: [PATCH 1/2] Add Test on ruby 2.4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c563a2..450bfd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: os: ['ubuntu', 'macos'] - ruby: [ '2.6', '2.7', '3.0' ] + ruby: [ '2.4', '2.5', '2.6', '2.7', '3.0' ] steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 From f823377c50a3558be157fabc57a2f0c8596e9de4 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 3 Jun 2021 10:48:47 +0900 Subject: [PATCH 2/2] Make tests pass in Ruby 2.4 --- lib/youplot/backends/processing.rb | 2 +- lib/youplot/dsv.rb | 2 +- lib/youplot/options.rb | 4 ++-- lib/youplot/parser.rb | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/youplot/backends/processing.rb b/lib/youplot/backends/processing.rb index ab373a9..6925b4e 100644 --- a/lib/youplot/backends/processing.rb +++ b/lib/youplot/backends/processing.rb @@ -18,7 +18,7 @@ module YouPlot # compare values r = b[1] <=> a[1] # If the values are the same, compare by name - r = a[0] <=> b[0] if r == 0 + r = a[0] <=> b[0] if r.zero? r end .transpose diff --git a/lib/youplot/dsv.rb b/lib/youplot/dsv.rb index b1d48fc..8dbd8f2 100644 --- a/lib/youplot/dsv.rb +++ b/lib/youplot/dsv.rb @@ -14,7 +14,7 @@ module YouPlot # Remove blank lines arr.delete_if do |i| - i == [] or i.all? nil + i == [] or i.all?(&:nil?) end # get header diff --git a/lib/youplot/options.rb b/lib/youplot/options.rb index 1fb2a3d..2a9fd3b 100644 --- a/lib/youplot/options.rb +++ b/lib/youplot/options.rb @@ -12,7 +12,7 @@ module YouPlot :progressive, :encoding, :color_names, - :debug, - keyword_init: true + :debug + # keyword_init: true ) end diff --git a/lib/youplot/parser.rb b/lib/youplot/parser.rb index 5d8323d..8c7aec5 100644 --- a/lib/youplot/parser.rb +++ b/lib/youplot/parser.rb @@ -15,16 +15,16 @@ module YouPlot @command = nil @options = Options.new( - delimiter: "\t", - transpose: false, - headers: nil, - pass: false, - output: $stderr, - fmt: 'xyy', - progressive: false, - encoding: nil, - color_names: false, - debug: false + "\t", # elimiter: + false, # transpose: + nil, # headers: + false, # pass: + $stderr, # output: + 'xyy', # fmt: + false, # progressive: + nil, # encoding: + false, # color_names: + false # debug: ) @params = Parameters.new