-
-
Notifications
You must be signed in to change notification settings - Fork 102
Ruby 2.7 support #392
Ruby 2.7 support #392
Conversation
02255e1
to
f9a3fae
Compare
f9a3fae
to
b2f4a68
Compare
c907307
to
56ce2e4
Compare
The major change here is removing the warning by using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I can't think of a better way around having code that is not supported by older parser.
@@ -38,6 +38,10 @@ def to_io | |||
def write(line) | |||
return if line =~ %r{^\S+/gems/\S+:\d+: warning:} # http://rubular.com/r/kqeUIZOfPG | |||
|
|||
# Ruby 2.7.0 complains about hashes used in place of keyword arguments | |||
# Aruba 0.14.2 uses this internally triggering that here | |||
return if line =~ %r{lib/ruby/2\.7\.0/fileutils\.rb:622: warning:} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvz you might be interested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pirj. This is fixed in Aruba 0.14.14.
56ce2e4
to
0930546
Compare
…2-26-for-master Ruby 2.7 support
if RubyFeatures.kw_args_supported? | ||
# Note on non keyword supporting Ruby ** causes a syntax error hence | ||
# we must use eval. To be removed in RSpec 4. | ||
binding.eval(<<-CODE, __FILE__, __LINE__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jon for the patch.
That's sad we have to do that to deal with Ruby 2.7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I can't think of another away around it except having an extra file thats not required by the older build... I'm unsure if I like that less...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes me too. The comments help for this part.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While fixing 2.7 compatibility for aruba, I found you can still pass the keyword arguments as a 1.8-style hash literal. This would allow getting rid of the eval. You would also lose the constants though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvz I think that depends on the API in use, I tried the hash directly with String#encode
and it still produces the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂
2.7.0 > "abc".encode("UTF-8", {:invalid => :replace})
(irb):2: warning: Using the last argument as keyword parameters is deprecated
=> "abc"
2.7.0 > "abc".encode("UTF-8", :invalid => :replace)
=> "abc"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂
…e-travis-build-scripts-2019-12-26-for-master Ruby 2.7 support --- This commit was imported from rspec/rspec-support@97ea7a0.
These are some updates, generated from rspec-dev's rake tasks.