Forum: Nitro Smarter nitro executable

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bd10252dc68b39171cc9bf5f74bcb9f1?d=identicon&s=25 Arne Brasseur (Guest)
on 2007-12-08 07:38
(Received via mailing list)
Another idea I've had, if the nitro executable would be able to figure
out if it's installed as a gem or not, it could in the second  case take
care itself of setting the loadpath for nitro. That way when running
from the repo you wouldn't have to juggle too many environment variables
and the likes, it would "just work".

Opinions?

(ab)

--
Ein Fuchs muß tun, was ein Fuchs tun muß
arne@arnebrasseur.net
7a4e995e378ef66de0ceaea5e1381ee1?d=identicon&s=25 George Moschovitis (Guest)
on 2007-12-08 10:40
(Received via mailing list)
Interesting idea,

do you feel capable of implementing this? It would be a great
contribution.

-g.
45196398e9685000d195ec626d477f0e?d=identicon&s=25 Trans (Guest)
on 2007-12-08 13:12
(Received via mailing list)
On Dec 8, 1:33 am, Arne Brasseur <a...@arnebrasseur.net> wrote:
> Another idea I've had, if the nitro executable would be able to figure
> out if it's installed as a gem or not, it could in the second  case take
> care itself of setting the loadpath for nitro. That way when running
> from the repo you wouldn't have to juggle too many environment variables
> and the likes, it would "just work".
>
> Opinions?

If you Roll all these problesm vanish.

T.
Bd10252dc68b39171cc9bf5f74bcb9f1?d=identicon&s=25 Arne Brasseur (Guest)
on 2007-12-09 07:57
(Received via mailing list)
George Moschovitis schreef:
> Interesting idea,
>
> do you feel capable of implementing this? It would be a great
> contribution.
I'll have a stab at it. I don't think it would be all that hard.

(ab)
Cff39e53f53bee0f034db5179582013c?d=identicon&s=25 Thomas Leitner (Guest)
on 2007-12-09 08:23
(Received via mailing list)
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):

module Webgen

   # Returns the data directory for webgen.
   def self.data_dir
     unless defined?( @@data_dir )
       @@data_dir =  File.expand_path( File.join( File.dirname
( __FILE__ ), '..', '..', 'data', 'webgen') )

       @@data_dir = File.expand_path( File.join( Config::CONFIG
["datadir"], "webgen" ) ) if !File.exists?( @@data_dir )

       raise "Could not find webgen data directory! This is a bug,
report it please!" unless File.directory?( @@data_dir )
     end
     @@data_dir
   end

end

Something similar should do the trick for the load path.

*hth*,
   Thomas
This topic is locked and can not be replied to.