if you don’t want to hoe… echoe

Hoe, a gem used to build gems, injects itself as a dependency into every gem it creates. To many people, this is unnecessary, since hardly anybody wants to perform meta-operations on a gem itself. Mainly they just want to use the included library.


The latest documentation for Echoe is here.

update 2

I don’t recommend bothering with the conditional require anymore. People can figure out a LoadError easily enough, and it really clutters up the Rakefile.

the fork of destiny

But we don’t want unused libraries on the production server. What to do? Forget Hoe, and write the Rakefile by hand? I’ve certainly seen people do that. But remember, Hoe is open source. So let’s fork it:

sudo gem install echoe

Echoe is part of the Snax Fauna, little beasts running all over the place.

what’s changed?

Echoe 1.0.0 is based on Hoe 1.1.6. However, it does not inject itself as a dependency. If you want to still publish meta tasks in a Rakefile, you could do as follows:

require 'rubygems'
require 'rake'
  require 'echoe'

  # all your regular Echoe/Hoe config

rescue LoadError => boom
  puts "You are missing a dependency required for meta-operations on this gem."
  puts "#{boom.to_s.capitalize}."

  desc 'No effect.'
  task :default; end

  # if you still want tests when Echoe is not present
  desc 'Run the test suite.'
  task :test do
     system "ruby -Ibin:lib:test some_tests_test.rb" # or whatever

Then, people can still run the tests, and in the unlikely event that they want to mess with the gem itself, they can install Echoe. But nothing is forced on you. No opinions. No vinegar. No badgers.

Maybe badgers.