Skip to content

Fix some posix spawn warnings#88

Merged
tmm1 merged 3 commits intortomayko:masterfrom
eileencodes:fix-posix-spawn-warnings
Jun 23, 2020
Merged

Fix some posix spawn warnings#88
tmm1 merged 3 commits intortomayko:masterfrom
eileencodes:fix-posix-spawn-warnings

Conversation

@eileencodes
Copy link
Contributor

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.

  • Fixes /lib/posix/spawn.rb:532: warning: deprecated Object#=~ is called on Array; it always returns nil deprecation that appears on Ruby 2.7. This deprecation is also present in application code and not just gem code/test runs
  • Fixes /test/test_spawn.rb:325: warning: ambiguous first argument; put parentheses or a space even after /' operator` which appears when tests are run.
  • Fixes warning: loading in progress, circular require considered harmful loading error present in Ruby 2.6 and 2.7.

`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
```
@tmm1 tmm1 merged commit a37695d into rtomayko:master Jun 23, 2020
@tmm1
Copy link
Collaborator

tmm1 commented Jun 23, 2020

Thanks!

@eileencodes eileencodes deleted the fix-posix-spawn-warnings branch June 23, 2020 23:02
@thepwagner
Copy link

@tmm1 would you be able to cut this into a release as well? (0.3.15 ?)

Also FYI this repo is missing the tag for v0.3.14 - https://github.com/rtomayko/posix-spawn/tags

@parkr parkr mentioned this pull request Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants