[Nitro] Rolls sounds interesting

TRANS transfire at gmail.com
Fri Aug 4 08:53:13 EDT 2006

On 8/4/06, Fabian Buch <fabian at oggu.de> wrote:
> hey Trans,
> http://roll.rubyforge.org/overview.html sounds very interesting.
> One question: has Rolls to be installed on a users system to require
> a versioned lib? (not for installing, I mean requireing, e.g. if the
> user just unpacked the package using tar or similar)

Generally speaking, yes. Becuase there is a version tier in lib/
structure. Otherwise a user would have to specify the version in the
path. Eg.

  require 'fruitapp/1.0.0/tryme'

Will work fine w/o Rolls.

Keep in mind though that it is also possible to distribute a
non-rolled layout and have a special installer "roll" it at
installation time instead. In which case just unpacking and using a
package would not have the same limitation. I have just such an
installer under development called Sow (sow.rubyforge.org).

> Considering the following directory structure:
>      fruitapp/
>        1.0.0/
>          fruit/
>            apple.rb
>          basket/
>            wicker.rb
> Now the user does:
>    require 'fruitapp'
> Would the developer usually put a fruitapp.rb at the highest level to
> require the current version and each time installing a new version
> would override this fruitapp.rb? What if someone installs an older
> version of a lib after he installed the latest version?

Yes, that can be a problem if the older version is functionally
different from the latest version. Top level files should really
contian nothing more then requires to a subdir. In fact, Rolls makes
it so you don't even neccessarily need a top level file becuase if you

  require 'fruitapp'

And a file doesn't exist by that name but a rolled lib does, Rolls
will automatically load 'fruitapp/{version}/index.rb' if it exists.

In anycase, you are right. This is the one area in which Rolls can
present some difficulties with version conflicts. If you have any
suggestions for improvement here, I'm all ears.


P.S. I plain to promote Rolls once Sow is a little further along.

More information about the Nitro-general mailing list