From: James Britt Date: 2004-11-10T02:50:09+09:00 Subject: Re: [ANN] Catapult 0.1.0 Released Austin Ziegler wrote: > On Tue, 9 Nov 2004 23:12:58 +0900, James Britt > wrote: > >>I've considered doing a gem, though I'm not sure if that is even worth it. >> >>The code is a script that kicks off WEBrick; it think that makes it more >>an application than a library. I call this script using a wrapper >>script so that I can set environment variables, so in that context, >>Catapult could be located as a Ruby lib. But, as a practical matter, >>the launch.rb app would likely to live someplace outside of the Ruby lib >>directories. >> >>If there are any suggestions on a good way to do this (as a gem or an >>rpa package, or both), please let me know. I've made gems, but no rpa >>packages, so this would be of interest to me. > > > Well ... I wrote an 18k management script for Ruwiki. It's probably > overkill, but some of the code could be made into a catapult launcher > deployment script. > > Also, if Catapult itself is smart enough to run from the directory in > which it is started, then you probably don't even need that. Catapult doesn't care where it starts. launch.rb calls "require 'catapult'", so from its pint of view, Catapult can be a library in the Ruby load path. The launch.rb code looks at text after __END__ to grab a list of directories to append to ENV['CATAPULT_LOAD']. I found that relative paths were tricky, because you start the script in a variety of ways. I've changed the code so that all relative paths in the __END__ section are treated as relative to launch.rb's directory. So, as a gem, installing catapult into the gem dirs is fine, as running Catapult via some caller script (e.g. launch.rb ) is arguably the better way to run it. But I don't think that launch.rb should go into a gems dir; $HOME/bin or /usr/local/bin or something along those lines seems more appropriate. I can write a simple installer script that does this, I just haven't been motivated. But I don't think gems or rpa manages selective placement of apps based on user choice. I believe they treat everything as something to install in the Ruby libs|gems directories. > > -austin