Skip to content

Commit

Permalink
Fix for Ruby versions prior to 2.4
Browse files Browse the repository at this point in the history
Before 2.4 the String#match? method was not available. This error
with introduced in commit 7b6215
  • Loading branch information
odlp committed Mar 19, 2017
1 parent 1950c01 commit 8eadada
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/postrank-uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def unescape(uri)
u = parse(uri)
u.query = u.query.tr('+', ' ') if u.query
u.to_s.gsub(URIREGEX[:unescape]) do |encoded|
if encoded.match? URIREGEX[:reserved_characters]
if !encoded.match(URIREGEX[:reserved_characters]).nil?
encoded
else
[encoded.delete('%')].pack('H*')
Expand Down

0 comments on commit 8eadada

Please sign in to comment.