From: R.. Kumar on
jeweler maintains a file VERSION in the base directory.
My program in bin has an option,

> prog --version.

Currently. I have a constant VERSION in prog.rb. This is never in synch
with the VERSION file, it should be.

Is there any way of either updating the constant whenever I do a jeweler
version:bump. Or else, my program inside lib/ should be able to get to
the VERSION file. However, note that File.open("../VERSION") fails since
it tries to check in the parent of the dir where user currently is
running the app from.

thx, rkumar
--
Posted via http://www.ruby-forum.com/.

From: Roger Pack on
, note that File.open("../VERSION") fails since
> it tries to check in the parent of the dir where user currently is
> running the app from.

File.open(File.dirname(__FILE__) + "/../VERSION")
--
Posted via http://www.ruby-forum.com/.

From: R.. Kumar on
Roger Pack wrote:
> , note that File.open("../VERSION") fails since
>> it tries to check in the parent of the dir where user currently is
>> running the app from.
>
> File.open(File.dirname(__FILE__) + "/../VERSION")

*duh* Thanks a lot !!
--
Posted via http://www.ruby-forum.com/.

From: R.. Kumar on
Roger Pack wrote:

Roger,

How do you post an announcement [ANN] to rubyforge.org and this forum.
Do you use post_news of rubyforge command ?

Is there something in rake ?

Thx.
--
Posted via http://www.ruby-forum.com/.

From: Rein Henrichs on
On 2010-06-22 11:38:09 -0700, Roger Pack said:

> , note that File.open("../VERSION") fails since
>> it tries to check in the parent of the dir where user currently is
>> running the app from.
>
> File.open(File.dirname(__FILE__) + "/../VERSION")

Roger, you shouldn't depend on files outside of the lib/ dir when
bundling your library as a gem. This was a problem for Rack for a while
as some tools will move the lib dir out and break your relative path.
--
Rein Henrichs
http://puppetlabs.com
http://reinh.com

 |  Next  |  Last
Pages: 1 2 3
Prev: XMPP client with Ruby
Next: ruby bounties update