- From: Daniel DeLeo <
>
- To: Chad Woolley <
>
- Cc: Chef Dev <
>
- Subject: [[chef-dev]] Re: [[chef-dev]] Discussion of gem version parsing
- Date: Sun, 23 May 2010 09:37:33 -0700
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
<
>
wrote:
>
Heads up on this Rubygems dev thread:
>
http://rubyforge.org/pipermail/rubygems-developers/2010-May/005418.html
>
Archive powered by MHonArc 2.6.16.