Skip to content

Commit

Permalink
Fix deprecation warning about =~ being called on TrueClass.
Browse files Browse the repository at this point in the history
With the code as it was, it will generate a warning like such:

.../websocket-extensions-0.1.3/lib/websocket/extensions/parser.rb:41:
warning: deprecated Object#=~ is called on TrueClass; it always returns
nil

So we will avoid if the variable is TrueClass.
  • Loading branch information
wilkie authored and jcoglan committed May 24, 2019
1 parent 68c1b21 commit 738a0af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/websocket/extensions/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def self.parse_header(header)
else
data = true
end
if data =~ NUMBER
if data != true and data =~ NUMBER
data = data =~ /\./ ? data.to_f : data.to_i(10)
end

Expand Down

0 comments on commit 738a0af

Please sign in to comment.