On Tue, 8 Apr 2003 james_b / neurogami.com wrote:

> > Why do we have to copy 'setup.rb' or 'install.rb' at all?  Why isn't there
> > a standard module that has methods that support installation.
>
> I tend to agree.  After I posted my quickie code I started thinking that
> Ruby should have at the least a built-in way to copy files to the site_ruby
> directory.  E.g.:

i posted some code a while back which i have been using personally for that
purpose.  the package i posted is called 'library', which as someone pointed
out is far too generic for what i actually posted, which does nothing beyond
library versioning.  i have for my own purposes however, mangled intstall.rb
so that i can use Library::install and Library::uninstall in just this way -
with version support.  the reason i picked such a generic name was that this
was my long term aim with this namespace (if anyone else wants to jump in go
for it).

> $ ruby -e copy_to_site_ruby name_of_file.rb
>
> If the file already exists, the code would prompt you to allow overwriting:
>
> $ File already exists, but is older.  Overwrite (y/n)?

this is a *very* bad idea.  ruby should support ***versioning***.

  packagename-interface.revision.age.{rb,so}

just like libtool versioning.  if this were supported, you could have a script
using

  require 'package', Library::Verion.new '2.1.0'

or

  require 'package.2.1.0'

for example

and pick up the latest package supporting the interface you require.  eg. when
2.2.0 comes along the require picks up that one.  the Library::install and
Library::unintall methods i have require packages live in a
'package-interface.revsion.age' named directory for this to work and a bunch
of other hacks i haven't had time to automate or inflict on anyone yet, but
they do allow one to have mutiple versioned installs of a package on site.
eg:

  cgi-0.1.0.rb
  cgi-2.1.2.rb
  cgi-3.1.0.rb

can all co-exist on the same system as 'cgi.rb', allowing users to install new
versions without breaking all their old scripts.

IMHO versioning is one of the biggest missing peices from the entire ruby
install process.  am i the only who feels this is very important?

just a few thoughts...

-a



>
>
> >
> > <plug> My installpkg that I put on RAA back in December was intended to be
> > a step in that direction and a catalyst for discussion.  Using installpkg
> > you write your own install.rb script which tends to be very simple and
> > looks like:
> >
> > require 'install-pkg'
> > include InstallPkg
> > InstallPkg.install_pkg('RHDL')
>
> How hard would it be for an installation module to know how to Do The Right Thing
> when called on a directory or tarball that fits a known format?  Then there would
> be only one installation script, and it would be part of the base Ruby installation.
>
>  InstallPkg.install_pkg() # defaluting to name_of_tarball_or_pwd_or_something_like_that
>
> Dependencies can be detemined by looking at the package source and verifying
> what is already installed.
>
> In any event, having a set of built-in installation tools would be sweet.
>
>
> James
>
>
>
>

--
  ====================================
  | Ara Howard
  | NOAA Forecast Systems Laboratory
  | Information and Technology Services
  | Data Systems Group
  | R/FST 325 Broadway
  | Boulder, CO 80305-3328
  | Email: ahoward / fsl.noaa.gov
  | Phone:  303-497-7238
  | Fax:    303-497-7259
  ====================================