beezwax/fmrest-ruby

String.match? call forces Ruby 2.4.x+

Closed this issue · 1 comments

The String.match? function was added to Ruby in 2.4.x; this function is invoked once in fmrest: https://github.com/beezwax/fmrest-ruby/blob/master/lib/fmrest/v1/token_session.rb#L74. Since String.match? throws an error on older Ruby versions, this prevents compatibility with 2.3.x and before.

Replacing host.match?(/\Ahttps?:\/\//) with an equivalent function (e.g. host =~ /\Ahttps?:\/\//) would allow for fmrest to be used with older versions of ruby. AFAICT, the advantage of .match? is that it doesn't override the $~ variable, which isn't relevant here.

pilaf commented

@alexduryee Thanks for reporting the issue!

I just released v0.2.4 with your suggested change.

f13a511
5197ce2