From: Robert Dober Date: 2010-04-20T17:34:59+09:00 Subject: Re: Documenting Rakefile using rdoc On Tue, Apr 20, 2010 at 1:55 AM, Joel VanderWerf wrote: > namespace "tasks" do >  rule /.*/ do |t| This is sooo cool, how come I never found this in the doc I needed it sooo badly. Cheers R. >    pats = t.name.split(":")[1..-1].map {|pat| Regexp.new("\\A#{pat}\\z")} >    Rake::Task.tasks.each do | tsk | >      next unless tsk.full_comment >      parts = tsk.name.split(":") >      next unless parts.size <= pats.size + 1 >      next unless pats.zip(parts).all? {|pat, part| pat === part} >      printf "rake %-19s# %s\n", tsk.name, tsk.full_comment >    end >  end > end > > Use it like this: > > $ rake tasks  # show all top level tasks > $ rake tasks:internals  # show all tasks in "internals" namespace > $ rake tasks:internals:'build.*' # show all tasks in "internals" namespace > whose name begins with build > > It probably still needs some tinkering... > > -- The best way to predict the future is to invent it. -- Alan Kay