[Rake-devel] Setting the description using a constructor

Jim Weirich jim at weirichhouse.org
Wed Nov 8 16:22:24 EST 2006

Daniel Berger said:
> Hi,
> I noticed that if I create a task using a constructor, the description
> doesn't seem to get picked up:
> desc "This is Dan's test"
> Rake::TestTask.new do |t|
>    # stuff here
> end

Ahh, that is because TestTask, despite its name, is not really a task
object.  Rather it is a suite of tasks that are created under the control
of the TestTask object.  You can think of it as a macro that creates a
bunch of tasks with related dependencies. I've been wanting to rename it
for some time, but haven't found quite the right terminology yet (suite is
one contender).

So the desc lines are defined within the TestTask object and aren't
exposed to the end user unless the author took explicit action to make it

-- Jim Weirich

-- Jim Weirich     jim at weirichhouse.org    http://onestepback.org
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

More information about the Rake-devel mailing list