Skip to content

Commit

Permalink
Fix deprecation warnings: Only match Strings (#95)
Browse files Browse the repository at this point in the history
* Object#=~ only makes sense on String

* update History and bump version
  • Loading branch information
mathieujobin authored Nov 25, 2022
1 parent 511ef91 commit 1be9bc1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
== 0.7.2
* Eliminate noisy warning: =~ called on anything but String objects.

== 0.7.1
* Eliminate noisy warning: =~ called on Array objects.

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile-rails.4.2.x.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GIT
PATH
remote: ..
specs:
pickle (0.7.1)
pickle (0.7.2)
cucumber (>= 3.0, < 8.0)
rake

Expand Down
2 changes: 1 addition & 1 deletion lib/pickle/session/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def match_field

def parse_hash(hash)
hash.inject({}) do |parsed, (key, val)|
if session && !val.is_a?(Array) && val =~ /^#{capture_model}$/
if session && val.is_a?(String) && val =~ /^#{capture_model}$/
parsed.merge(key => session.model($1))
else
parsed.merge(key => val)
Expand Down
2 changes: 1 addition & 1 deletion lib/pickle/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Pickle
VERSION = "0.7.1"
VERSION = "0.7.2"
end

0 comments on commit 1be9bc1

Please sign in to comment.