From e6bea538a84c61beadea22f359c4a73a783840e9 Mon Sep 17 00:00:00 2001 From: kibitan Date: Thu, 14 Mar 2024 17:23:38 +0100 Subject: [PATCH] =?UTF-8?q?style:=20=F0=9F=92=84=20apply=20rubocop=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/masking/cli.rb | 2 +- lib/masking/insert_statement.rb | 2 +- spec/masking/cli_spec.rb | 4 ++-- spec/spec_helper.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/masking/cli.rb b/lib/masking/cli.rb index e0f42a34..2daeab6e 100644 --- a/lib/masking/cli.rb +++ b/lib/masking/cli.rb @@ -44,7 +44,7 @@ def define_config_option(parser) def define_version_option(parser) parser.on('-v', '--version', 'version') do puts Masking::VERSION - exit(true) + exit end end end diff --git a/lib/masking/insert_statement.rb b/lib/masking/insert_statement.rb index 26e0f4a2..1c9ef873 100644 --- a/lib/masking/insert_statement.rb +++ b/lib/masking/insert_statement.rb @@ -79,7 +79,7 @@ def values_regexp # e.g. INSERT ... VALUES (123,'string ),( abc'),(456,'ab'); # refs: implementation of parsing CSV on ruby standard library FasterCSV (ja): https://www.clear-code.com/blog/2018/12/25.html def recursive_pattern_value_concat!(value_rows, index) - return if value_rows[index].gsub(/\\\\/, '').gsub(/\\'/, '').count(?').even? + return if value_rows[index].gsub('\\\\', '').gsub("\\'", '').count(?').even? # make destructive change for values_rows value_rows[index] += VALUE_ROW_SPLITTER + value_rows.delete_at(index + 1) diff --git a/spec/masking/cli_spec.rb b/spec/masking/cli_spec.rb index 67c937c9..1dec7398 100644 --- a/spec/masking/cli_spec.rb +++ b/spec/masking/cli_spec.rb @@ -27,7 +27,7 @@ shared_examples 'print Version and exit' do it do - expect { subject }.to raise_error(SystemExit) & \ + expect { subject }.to raise_error(SystemExit) & output("#{Masking::VERSION}\n").to_stdout end @@ -75,7 +75,7 @@ shared_examples 'with errormessage and exitstatus is 1' do |error_text| it do - expect { subject }.to raise_error(SystemExit) & \ + expect { subject }.to raise_error(SystemExit) & output(error_text).to_stderr end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 147c9602..06cd512f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,7 +5,7 @@ require 'tapp' require 'simplecov' -if ENV['CI'] == 'true' && \ +if ENV['CI'] == 'true' && # compare only for major/minor version of Ruby in order to enable report for Coverall Gem::Version.new(RUBY_VERSION).segments[0..1] == \ Gem::Version.new(File.read(File.join(File.dirname(__FILE__), '../.ruby-version'))).segments[0..1]