From: Roger Pack Date: 2010-06-23T23:12:46+09:00 Subject: Re: print gem VERSION from ruby program Rein Henrichs wrote: > 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. Good point. For bundling sake I'd therefore suggest moving the file VERSION into your lib dir. Though, in reality, it's probably the tools that should bundle the whole gem not just its lib dir...at least if they want to be totally gem compatible. -r -- Posted via http://www.ruby-forum.com/.