Nobuyoshi Nakada
8/13/2006 8:37:00 AM
Hi,
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...)
def adventurous!
verbose, $VERBOSE = $VERBOSE, nil
yield
ensure
$VERBOSE = verbose
end
adventurous! {system(cmd)}
> 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.
See $!.success?.
--
Nobu Nakada