When you access ENV or execute a subshell, ruby
gives you a warning if any parent directory in
any part of your search path is world-writable.
Unfortunately, we're talking about system directories
I have no control over, that have to be in my
search path, so that warning gets to be a bit
annoying after a while.
I understand why it's there, but it's even worse
for scripts I distribute: They cause alarm bells
go off, right at the time I'm trying to lull
people to sleep... (Relax... Sleep... Pay no
attention to the ruby under the hood...)
The workaround is to code a semi-colon at the
end of the command, so:
sh "some command;"
or
value = `some command;`
But the unfortunate side effect is that a command
failure gets swallowed as well, and that keeps
Rake from aborting when it rightfully should.
So:
I need a way to make the world-writable
directory warning go away, and at the
same time make sure that Rake sees shell
aborts.
At Sun, 13 Aug 2006 12:23:07 +0900,
Eric Armstrong wrote in [ruby-talk:208107]:
Unfortunately, we're talking about system directories
I have no control over, that have to be in my
search path, so that warning gets to be a bit
annoying after a while.
World writable system directories? Hmmm..., amazing.
I understand why it's there, but it's even worse
for scripts I distribute: They cause alarm bells
go off, right at the time I'm trying to lull
people to sleep... (Relax... Sleep... Pay no
attention to the ruby under the hood...)
When you access ENV or execute a subshell, ruby
gives you a warning if any parent directory in
any part of your search path is world-writable.
...
The workaround is to code a semi-colon at the
end of the command, so:
sh "some command;"
or
value = `some command;`
But the unfortunate side effect is that a command
failure gets swallowed as well, and that keeps
Rake from aborting when it rightfully should.
It turns out I was (happily) dead wrong about that.
Either of the following work just fine:
if ($? != 0) then
...
exit
end
-or-
require 'English'
if ($CHILD_STATUS != 0) then
...
exit
endif