You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@buildr.apache.org by Shane Witbeck <sh...@digitalsanctum.com> on 2008/11/27 16:01:32 UTC

location of buildr

I'm updating a Buildr plugin I wrote a while back for IntelliJ IDEA and have
a question:

What's the best way of determining where the buildr script is located?

I can make guesses depending on which platform is being used or get the path
from running 'which buildr' on *nix platforms but I have no good way to
check on Windows. Any ideas?


-Shane

Re: location of buildr

Posted by Victor Hugo Borja <vi...@gmail.com>.
On Thu, Nov 27, 2008 at 9:01 AM, Shane Witbeck <sh...@digitalsanctum.com>wrote:

> I'm updating a Buildr plugin I wrote a while back for IntelliJ IDEA and
> have
> a question:
>
> What's the best way of determining where the buildr script is located?
>
> I can make guesses depending on which platform is being used or get the
> path
> from running 'which buildr' on *nix platforms but I have no good way to
> check on Windows. Any ideas?
>

Buildr has a `which` method defined on rakelib/setup.rake that for windows
does the following:

       path = ENV['PATH'].split(File::PATH_SEPARATOR).map { |path|
path.gsub('\\', '/') }.map { |path| "#{path}/#{name}.{exe,bat,com}" }

If you installed buildr with rubygems the executable should live in the
GEM_HOME/bin directory, I guess GEM_HOME for windows (as installed by
"one-click ruby") should c:\ruby\lib\gems\1.8, but I could be wrong )