From: cldwalker Date: 2009-04-14T13:45:06+09:00 Subject: Re: how do you manage your gems' gemspecs? On Apr 13, 5:04 pm, Eric Hodel wrote: > On Apr 9, 2009, at 20:00, ghorner wrote: > > >  I'm curious how people manage creating their gemspecs. I'm not > > asking for a flame war on gem creators i.e. hoe vs newgem vs jeweler. > > I'm just wondering if your gem creators encourage creating Rakefiles > > with some gemspec configuration inside of it. If so, how do you do > > this gem after gem and not get annoyed that you're not being DRY? > > I ended up going with a solution where I generate all my gem's > > gemspecs from one config file:http://github.com/cldwalker/dotfiles/blob/master/.gems.yml > > . > > This makes it harder for other people to develop with your gems.  Now   > they need two things in order to build your gems if they want to   > install a gem. My gem's build dependency is a config file containing file globs. This is no more of an extra dependency than a manifest file or a Rakefile with embedded file globs. Since my gem rebuilding doesn't depend on my global config file, I'm not sure what two things you're referring to and why it'd be harder for someone ... Actually, when rebuilding my contributors would have one less dependency: no gem creator dependency (i.e. no hoe or jeweler dependency). Just with the rake task mentioned at the end of my post, they could rebuild my gems. > > Using globs is a bad idea, you end up including files you don't want   > in your gem.  A manifest file that gets automatically checked at   > release time solves this problem elegantly. Since I'd be generating my manifest file from a rake task using globs, I'm not sure how manifest files help. If you're creating manifest files by hand, then that's a level of file- checking I personally don't want for every file change. > > > I wrote more about my solution here: > >http://tagaholic.me/2009/04/08/building-dry-gems-with-thor-and-jewele... > > How do you manage your gems' gemspecs? > > I keep them per-project and largely generate them from the non-Rakefile: > > Hoe.new('gmail_contacts', GmailContacts::VERSION) do |p| >    p.rubyforge_name = 'seattlerb' >    p.developer 'Eric Hodel', 'drbr...@segment7.net' > >    p.extra_deps << ['gdata', '~> 1.0'] >    p.extra_deps << ['nokogiri', '~> 1.2'] > end > > description, summary, and homepage are all figured out for me from the   > README.txt Thanks for sharing. I prefer my gem metadata in an open format i.e. yaml. Having to extract them from the readme and/or a Hoe or Jeweler config just adds more work and dependencies.