Forum: Ruby Abort Rake Task

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
brian.takita (Guest)
on 2005-11-14 00:14
(Received via mailing list)

I have a rake task named setup, that depends on a file task that
creates a yml file that has the path to ruby on the system. I would
like setup to abort if the file is created and tell the user to edit
the yml file to the actual ruby path.

So far, the only way I can think of to do it is using the exit method.

However I get the following message:
$ rake setup
(in /cygdrive/c/dev/ruby/project)
property 'svn:ignore' set on '.'
Please edit the ruby_env.yml file with the path to ruby on your system.
Then run 'rake setup' again.
rake aborted!
../rakefile:37:in `exit'

However, the last three lines look like an error and would probably be
confusing to the user.

Is there a more elegant way to do this in rake?

Thank you,
Brian T.
This topic is locked and can not be replied to.