🕷 zenspider.com

by ryan davis



sitemap
Looking for the Ruby Quickref?

Hoe 1.5: Rakefile before and after

Published 2008-01-31 @ 01:12

Tagged Seattle.rb, ruby, hoe

With hoe 1.5, I finally got some changes in that I’ve wanted for a long long time… No more tweaking my Rakefile back and forth in order to adjust for changes in my history or readme files! Hoe now knows how to read the default structure of the files. As such, it automatically fills in description, summary, url, and changes for you (unless you override it). This takes my Rakefile from this:

  require 'rubygems'
  require 'hoe'
  require './lib/zentest.rb'
  
  Hoe.new("ZenTest", ZenTest::VERSION) do |p|
    p.author = ['Ryan Davis', 'Eric Hodel']
  
    changes = p.paragraphs_of("History.txt", 0..4).join("\n\n")
    urls, summary, *description = p.paragraphs_of("README.txt", 1, 3, 3..8)
  
    p.url = urls.gsub(/^\* /, '').split(/\n/)
    p.changes = changes
    p.summary = summary
    p.description = description.join("\n\n")
  end

to this:

  require 'rubygems'
  require 'hoe'
  require './lib/zentest.rb'
  
  Hoe.new("ZenTest", ZenTest::VERSION) do |zentest|
    zentest.developer('Ryan Davis', 'ryand-ruby@zenspider.com')
    zentest.developer('Eric Hodel', 'drbrain@segment7.net')
  end

Pretty, eh?