Skip to content

Commit 738a0af

Browse files
wilkiejcoglan
authored andcommitted
Fix deprecation warning about =~ being called on TrueClass.
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.
1 parent 68c1b21 commit 738a0af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/websocket/extensions/parser.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def self.parse_header(header)
3838
else
3939
data = true
4040
end
41-
if data =~ NUMBER
41+
if data != true and data =~ NUMBER
4242
data = data =~ /\./ ? data.to_f : data.to_i(10)
4343
end
4444

0 commit comments

Comments
 (0)