[#97678] [Ruby master Feature#16752] :private param for const_set — bughitgithub@...
Issue #16752 has been reported by bughit (bug hit).
5 messages
2020/04/02
[ruby-core:97975] [Ruby master Feature#16791] Shortcut for Process::Status.exitstatus
From:
nobu@...
Date:
2020-04-20 08:00:43 UTC
List:
ruby-core #97975
Issue #16791 has been updated by nobu (Nobuyoshi Nakada).
It is not a good idea to compare `exitstatus` with 0 from the point of portability.
I'd recommend to use `Process::Status#success?`.
Also if the exit code value is not important but succeeded or failed is just needed, `exit $?.success?` would be enough.
Even `exec` works better than `system` & `exit`, unless you need some clean-ups.
----------------------------------------
Feature #16791: Shortcut for Process::Status.exitstatus
https://bugs.ruby-lang.org/issues/16791#change-85205
* Author: 0x81000000 (/ /)
* Status: Open
* Priority: Normal
----------------------------------------
[Updated]
```
s = `csc x.cs`.sub(/.*?\n\n/m, '')
puts s if s != ''; exit $?.exitstatus if $?.exitstatus > 0
system 'mono x.exe'; exit $?.exitstatus
```
```
class Process::Status
alias :es :exitstatus
end
```
```
s = `csc x.cs`.sub(/.*?\n\n/m, '')
puts s if s != ''; exit $?.es if $?.es > 0
system 'mono x.exe'; exit $?.es
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>