2009/10/14 Intransition <transfire / gmail.com>:
> I recently came across two different programs that had this line in a
> bin/ executable:
>
> $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../
> lib"))
>
> This stuff makes me sad. The use of RubyGems is masking some bad
> practices here. The above code would not work with a traditional site
> installation.

It's not for site installation.

It's for packaged applications.

I wrote a pure ruby application that you can just unpack and run, no
need to "install" it on your system, and it uses the exact code you
show except it does not use the "/../".

This is ideal for situations when you do not want to require the users
to have a development environment ready to "install" the application.
Just having a ruby interpreter preinstalled from a binary package
suffices.

Thanks

Michal