Dealing with JRuby and jars
drbrain at segment7.net
Wed Jan 18 23:42:07 EST 2012
On Jan 18, 2012, at 2:49 PM, Charles Oliver Nutter wrote:
> b) make it easier to hook the spec retrieval + gem fetch process
> I prefer the latter, since it allows us to build the gems any way we
> want, so long as we feed RubyGems a valid spec and provide it smarts
> to get a .gem file in hand.
in master I've unified Gem::Package::TarInput, Gem::Package::TarOutput, Gem::Format and Gem::Builder into Gem::Package which handles all the work of reading and writing .gem files. There's also Gem::Package::Old for the YAML-ish gems.
While there's no hook to replace Gem::Package with an alternate implementation, the required API is:
#spec= to provide a Gem::Specification for building
#build to build a .gem file for the spec
#spec to retrieve a Gem::Specification from a .gem file
#extract_files(dir) to extract the data.tar.gz
Additionally, #verify is called from #spec for Gem::Package and ensures the gem is correctly formatted and complete.
More information about the RubyGems-Developers