Prev: XMPP client with Ruby
Next: ruby bounties update
From: R.. Kumar on 22 Jun 2010 14:02 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 22 Jun 2010 14:38 , 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 23 Jun 2010 00:08 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 23 Jun 2010 02:30 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 23 Jun 2010 03:29
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 |