<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
I do the following for getting the data directory in webgen which works in all cases (not installed, installed via setup.rb and installed via gems):<div><br class="webkit-block-placeholder"></div><div>module Webgen</div><div><br class="webkit-block-placeholder"></div><div><div>  # Returns the data directory for webgen.</div><div>  def self.data_dir</div><div>    unless defined?( @@data_dir )</div><div>      @@data_dir =  File.expand_path( File.join( File.dirname( __FILE__ ), '..', '..', 'data', 'webgen') )</div><div><br class="webkit-block-placeholder"></div><div>      @@data_dir = File.expand_path( File.join( Config::CONFIG["datadir"], "webgen" ) ) if !File.exists?( @@data_dir )</div><div><br class="webkit-block-placeholder"></div><div>      raise "Could not find webgen data directory! This is a bug, report it please!" unless File.directory?( @@data_dir )</div><div>    end</div><div>    @@data_dir</div><div>  end</div><div><br class="webkit-block-placeholder"></div><div>end</div><div><br class="webkit-block-placeholder"></div><div>Something similar should do the trick for the load path.</div><div><br class="webkit-block-placeholder"></div><div>*hth*,</div><div>  Thomas</div><div><br class="webkit-block-placeholder"></div><div><div>On 08.12.2007, at 10:38, George Moschovitis wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Interesting idea,<br><br>do you feel capable of implementing this? It would be a great contribution.<br><br>-g.<br><br><div class="gmail_quote">On Dec 8, 2007 8:33 AM, Arne Brasseur &lt;<a href="mailto:arne@arnebrasseur.net"> arne@arnebrasseur.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Another idea I've had, if the nitro executable would be able to figure <br>out if it's installed as a gem or not, it could in the second  case take<br>care itself of setting the loadpath for nitro. That way when running<br>from the repo you wouldn't have to juggle too many environment variables <br>and the likes, it would "just work".<br><br>Opinions?<br><br>(ab)<br><br>--<br>Ein Fuchs muß tun, was ein Fuchs tun muß<br><a href="mailto:arne@arnebrasseur.net">arne@arnebrasseur.net</a><br><br><br>_______________________________________________ <br>Nitro-general mailing list<br><a href="mailto:Nitro-general@rubyforge.org">Nitro-general@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/nitro-general" target="_blank">http://rubyforge.org/mailman/listinfo/nitro-general </a></blockquote></div><br><br clear="all"><br>-- <br><a href="http://me.gr">http://me.gr</a><br><a href="http://joy.gr">http://joy.gr</a><br><a href="http://cull.gr">http://cull.gr</a><br><a href="http://nitroproject.org"> http://nitroproject.org</a><br><a href="http://phidz.com">http://phidz.com</a><br><a href="http://joyerz.com">http://joyerz.com</a><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Nitro-general mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:Nitro-general@rubyforge.org">Nitro-general@rubyforge.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://rubyforge.org/mailman/listinfo/nitro-general">http://rubyforge.org/mailman/listinfo/nitro-general</a></div> </blockquote></div><br></div></body></html>