Closed bdunne closed 8 years ago
@logicminds I introduced this bug yesterday in https://github.com/logicminds/rubyipmi/pull/29
What was the code that created this issue? I have never need this before?
Rubocop suggested a change from $?
to $CHILD_STATUS
. Running any command looks at the return code. I'm on ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
would need to check if 1.9.3+ supports this.
Yes, this appears to be a ruby 1.9.3+ thing. I just switched to 1.9.3 and verified that it works there.
irb(main):001:0> `true`
=> ""
irb(main):002:0> $?
=> #<Process::Status: pid 6497 exit 0>
irb(main):003:0> $CHILD_STATUS
=> nil
irb(main):004:0> require "English"
=> true
irb(main):005:0> $CHILD_STATUS
=> #<Process::Status: pid 6497 exit 0>
irb(main):006:0> RUBY_VERSION
=> "1.9.3"
I would prefer to go back to original $?. Seems silly that we need to require another file just to use something that should be built into ruby core.
Switched back to $?
and added to the ignore list
Some ruby versions need to require 'English' otherwise $CHILD_STATUS is nil