Merged
Conversation
`args[0]` in some cases can be an array. We only want to compare the object when it's a string. This code checks if `args[0]` is a string to fix the following deprecation warning in Ruby 2.7. Fixes: ``` /lib/posix/spawn.rb:532: warning: deprecated Object#=~ is called on Array; it always returns nil ```
Fixes: ``` /test/test_spawn.rb:325: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
The file doesn't need to be required, it's already included. Fixes ``` /lib/posix/spawn/child.rb:1: warning: /lib/posix/spawn/child.rb:1: warning: loading in progress, circular require considered harmful - /lib/posix/spawn.rb ```
Collaborator
|
Thanks! |
|
@tmm1 would you be able to cut this into a release as well? ( Also FYI this repo is missing the tag for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello! 👋
We're seeing the first warning in our app and would like to fix this so that we can continue upgrading Ruby versions. If you don't want the other changes I'm happy to rebase them out since the first Object warning is the only one we actually need to be warning free in our application
This PR fixes 3 warnings coming from Ruby.
/lib/posix/spawn.rb:532: warning: deprecated Object#=~ is called on Array; it always returns nildeprecation that appears on Ruby 2.7. This deprecation is also present in application code and not just gem code/test runs/test/test_spawn.rb:325: warning: ambiguous first argument; put parentheses or a space even after/' operator` which appears when tests are run.warning: loading in progress, circular require considered harmfulloading error present in Ruby 2.6 and 2.7.