I've been trying to make my pipeline (following rubocop syntax) and Linux/ Windows machines happy but for some reason I am stuck in the exit status checking. It is causing problem.
I have used the following and the below results:
$?.exitstatus
- NOT OK in rubocop (syntax concerns); OK in Linux; OK in Windows
system()
- OK in rubocop; OK in Linux; NOT OK in Windows (it is not recognized as an internal or external command
)
$CHILD_STATUS.exitstatus
- OK in rubocop; NOT OK in Linux (it needs require 'English'
library); OK in Windows
I don't want to install anything in the machines. Any best way to make it all OK?
Thank you.
The accepted way is:
require 'English' # Capital 'E'!
$CHILD_STATUS.exitstatus
Note that the English
lib is a standard lib that comes bundled with all versions of Ruby