Discussion of gem version parsing


#1

Heads up on this Rubygems dev thread:
http://rubyforge.org/pipermail/rubygems-developers/2010-May/005418.html


#2

I’ve been talking to Eric Hodel (drbrain) about it on #rubygems in
IRC. We’ve planned to use the RubyGems API for a long time, but there
are a few issues that have been holding us back:

  • Chef lets you manage any rubygems installation on the system, so you
    can’t use the class methods on Gem to get information about the
    rubygems installation.
  • Related to the above, Gems with C extensions need to be installed
    from the correct version of ruby because the C API changes. Gem
    authors use C macros provided by ruby to get the correct code for each
    version, and these are determined when the C preprocessor runs.

What I think we’ll do is use the gem env gempath command to find the
rubygems directories used by a given rubygems installation (only when
a gem_binary parameter is present in the gem_package resource), then
use Gem::SourceIndex.from_gems_in to get the source index for those
gems. To install, we can use Gem::DependencyInstaller if gem_binary is
not present, or continue to shell out when gem binary is present.

I still need to research further how to look up the gem indexes from servers.

HTH,
Dan DeLeo

On Sun, May 23, 2010 at 1:24 AM, Chad Woolley thewoolleyman@gmail.com wrote:

Heads up on this Rubygems dev thread:
http://rubyforge.org/pipermail/rubygems-developers/2010-May/005418.html


#3

On Sun, May 23, 2010 at 9:37 AM, Daniel DeLeo dan@kallistec.com wrote:

I’ve been talking to Eric Hodel (drbrain) about it on #rubygems in
IRC. We’ve planned to use the RubyGems API for a long time, but there
are a few issues that have been holding us back:

OK. In the meantime, the current implementation is broken in some
cases (e.g. mysql gem). I’ve included a fix on
http://tickets.opscode.com/browse/CHEF-1168
(http://github.com/thewoolleyman/chef/tree/CHEF-1168)

– Chad