-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve textual representation of Process::Status
#13012
Comments
Shouldn't the second snippet use For Windows it might be helpful to have things like Also I didn't realize |
Yeah, fixed 😅 |
Yes, it should be. I opened #13015 to track that. |
|
But currently there's no way to express a stopped signal, right? So I'm thinking this should be left for an enhancement later. |
I think they show up from |
Process::Status
currently has very intricate#to_s
and#inspect
formats. They're the default implementations inherited fromReference
and don't convey much relevant information.I'm proposing to implement a more meaningful representation.
#to_s
currently returns the type name and object id in the typical format ofReference#to_s
(e.g.#<Process::Status:0x7f9fd8a17c40>
). That doesn't make much sense. The object id is pretty much irrelevant.Instead, it should simply return a textual representation of the exit code or signal:
(I'm using a ficticious
process_status
helper to represent instances with certain values becauseProcess::Status
doesn't have a public or easily usable constructor - which should probably be added as well.)#inspect
currently enhances the sparse information output of#to_s
by the names of the instance variables and their values.@exit_status
is the only ivar and its value is bit encoded, thus not trivial to read. This isn't very useful.Instead, it should return a textual representation of the exit code or signal, like
#to_s
but enhanced with the type information ofProcess::Status
for more expressiveness.The text was updated successfully, but these errors were encountered: