From 511ef914c7ae7c9bcc30435b4132a5e09838ed11 Mon Sep 17 00:00:00 2001 From: Mathieu Jobin Date: Wed, 20 Jul 2022 14:59:34 +0900 Subject: [PATCH] fix warning: dont call =~ on an Array, which is returning nil anyhow (#94) * fix warning: dont call =~ on an Array, which is returning nil anyhow * update History file and bump version * bump version in 4.2 lock file as well --- History.txt | 6 ++++++ gemfiles/Gemfile-rails.4.2.x.lock | 2 +- lib/pickle/session/parser.rb | 2 +- lib/pickle/version.rb | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/History.txt b/History.txt index 6e209787..8a8a14ff 100644 --- a/History.txt +++ b/History.txt @@ -1,3 +1,9 @@ +== 0.7.1 +* Eliminate noisy warning: =~ called on Array objects. + +== 0.7.0 +* Rails 7.0.x support. + == 0.6.2 * Relax dependency to support cucumber 7.x diff --git a/gemfiles/Gemfile-rails.4.2.x.lock b/gemfiles/Gemfile-rails.4.2.x.lock index 1c0c0c3f..2337ce3b 100644 --- a/gemfiles/Gemfile-rails.4.2.x.lock +++ b/gemfiles/Gemfile-rails.4.2.x.lock @@ -8,7 +8,7 @@ GIT PATH remote: .. specs: - pickle (0.7.0) + pickle (0.7.1) cucumber (>= 3.0, < 8.0) rake diff --git a/lib/pickle/session/parser.rb b/lib/pickle/session/parser.rb index 4b6330ab..10d190af 100644 --- a/lib/pickle/session/parser.rb +++ b/lib/pickle/session/parser.rb @@ -24,7 +24,7 @@ def match_field def parse_hash(hash) hash.inject({}) do |parsed, (key, val)| - if session && val =~ /^#{capture_model}$/ + if session && !val.is_a?(Array) && val =~ /^#{capture_model}$/ parsed.merge(key => session.model($1)) else parsed.merge(key => val) diff --git a/lib/pickle/version.rb b/lib/pickle/version.rb index 49f1690a..29a64c68 100644 --- a/lib/pickle/version.rb +++ b/lib/pickle/version.rb @@ -1,3 +1,3 @@ module Pickle - VERSION = "0.7.0" + VERSION = "0.7.1" end