[Rubygems-developers] Two feature requests

Austin Ziegler halostatue at gmail.com
Wed Sep 22 13:01:01 EDT 2004

On Wed, 22 Sep 2004 18:42:24 +0200, Mauricio Fernández
<batsman.geo at yahoo.com> wrote:
> On Wed, Sep 22, 2004 at 12:02:47PM -0400, Austin Ziegler wrote:
> > 2. In the latest Ruwiki version, I have two different Readme files --
> > one for the tarfile and one for the Rubygem (and there will be a third
> > one for RPA, but I'll leave it to the RPA team to make the
> > modifications to the Rubygem one). When I'm packing the tarfile --
> > using Archive::Tar::Minitar -- I read "Readme.tarfile" and save it in
> > the tarfile as "Readme". I'm also changing the mode on the files
> > (e.g., bin/ becomes 0755, directories are 0555, and everything else is
> > 0644) and the mtime (to the release date, if ENV['RELEASE_DATE'] is
> > provided; I'm using Rake for this). I'd like to do the same thing with
> > the Rubygem -- but this isn't currently possible. I have to manually
> > rename "Readme.rubygems" to "Readme", and I can't set specific modes
> > or mtimes for the files.
> Currently, such things are normally taken care of with Rake since RubyGems
> has got no build phase. Regarding files modes and mtimes, maybe it would
> be possible to backport the modifications you introduced in
> Archive:Tar::Minitar, but the required changes in the gemspec might be
> too cumbersome.

Actually, I'm talking about during "gem build", not during
installation. Right now, the file list is expected to be an array of
Strings, e.g.:

  [ "Readme", "bin/minitar", ... ]

However, what if it were an array of Strings and Hashes?

  [ "bin/minitar",
    { "Readme.gemspec" => [ "Readme", Time.mktime(2004, 01, 01), 0644 ] } ]

Not the best choice, but it works. Archive::Tar::Minitar actually
expects an array of hashes:

  { :name => "Readme", :mtime => Time.mktime(2004, 01, 01), :mode => 0644 }

I'm having to do some funky stuff with the Rakefile for Ruwiki because
"Readme" doesn't exist; I want to rename "Readme.tarfile" to "Readme".
I can do this, however, during the packing stage. (Actually, it's a
little better than that, because during the Rake packaging, I'm also
providing :data => File.read("Readme.tarfile")).

Austin Ziegler * halostatue at gmail.com
               * Alternate: austin at halostatue.ca
: as of this email, I have [ 6 ] Gmail invitations

More information about the Rubygems-developers mailing list