I recently discovered the Hanna RDoc template and I like it a lot more than the default. I want to use it in my project, but I also don't want my project to require it.
The only change I had to make to my Rakefile to get the hanna template to work was to change
require 'rake/rdoctask'
to
require 'hanna/rdoctask'
Is there any way to attempt a require, and capture/recover from the error? I noticed load and require return a boolean in irb, so I thought maybe I could do this:
unless require 'hanna/rdoctask'
require 'rake/rdoctask'
end
Sadly, rake aborted as soon as the require failed. Then I tried:
begin
require 'hanna/rdoctask'
rescue
require 'rake/rdoctask'
end
but that didn't work either.
Is there any way to accomplish what I'm attempting here?