Well, RubyConf 2003 is wrapped up and I am here at the Austin Airport with Chad Fowler and Jim Weirich. We had a great time...lots of great speakers, food and break-talks. On Friday we were there in a roundtable with Matz and someone brought up package management for Ruby (again!). Matz said if someone built a good one, he would include it in Ruby. So Chad, myself, Jim, David Black and Paul Brannan decided to just do it. We have two nights...let's build RubyGems!
We paired up and attacked the problem Friday night from 9 pm to 2 am, then a bit of discussion during the day on Saturday (and a bit of coding during the talks...shh), then Saturday night from 9 pm to 1 am and our results are up on RubyForge here.
We got an impressive start (code committed). We have Gem building, installation, uninstall, version support, dependency support, and apt-get like capability (for network installs). Of course, its really simple to use (thanks Ruby/Matz).
Here is a gemspec for Jabber4r:
require 'rubygems' spec = Gem::Specification.new do |s| s.add_dependency('rexml', '> 2.7.0') s.name = 'jabber4r' s.version = "0.5.0" s.platform = Gem::Platform::RUBY s.summary = "Jabber4r is a pure-Ruby Jabber client library" s.requirements << 'Jabber server' s.files = Dir.glob("lib/**/*").delete_if {|item| item.include?("CVS")} s.require_path = 'lib' s.autorequire = 'jabber4r/jabber4r' s.author = "Richard Kilmer" s.email = "[email protected]" s.rubyforge_project = "jabber4r" s.homepage = "http://jabber4r.rubyforge.org" end if $0==__FILE__ Gem::Builder.new(spec).build end
Pretty spiffy. You execute that with:
ruby jabber4r.gemspec Successfully built RubyGem Name: jabber4r Version: 0.5.0 File: jabber4r-0.5.0.gem
That generates the .gem file (with version) and you install like this:
sudo ruby jabber4r-0.5.0.gem Successfully installed jabber4r version 0.5.0
Then to use it:
irb -r rubygems > require_gem 'jabber4r' true
Gems manage the $LOAD_PATH of Ruby which lets two different versions of a Gem be installed and two scripts could each use the one they want. The gem --remote-install will be available once a service goes up on RubyForge. For now, you can serve Gems off of your machine to anyone on your local network.
I will post more about RubyConf soon.