Closed jkowens closed 9 years ago
Hey. I'm sorry I didn't get to your question about how to deal with this before you worked up a patch for it.
I'd been discussing how to fix this with James Abbott earlier this year, and when I saw your question I wondered why there wasn't a pull request for it. It turns out he put a patch on his fork but never sent me a pull request, most likely because his tests would have been failing.
I'd have merged this, but James and I had got as far as deciding we should print an error message rather than a stack trace. If it's any consolation, your $?.exitstatus
code was very handy, as my initial approach (checking the return value of system
) doesn't work as it says it should in the Ruby docs (it returns nil
far more often than it ought to).
And if you hadn't sent a PR, I'd never have dug into what happened to James's patch, so in effect you've still fixed it…
No worries, I was just looking for a small challenge. I'm glad I was able to help in some way :)
Adds a
run
method to the Command module that wrapssystem
calls. A RuntimeError is raised if the system call fails.