Forum: Ruby Rake default == -T

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
45196398e9685000d195ec626d477f0e?d=identicon&s=25 TRANS (Guest)
on 2006-04-27 13:18
(Received via mailing list)
Hi,

Is it possible to make the default task the same as using the -T
option? I.e. I want to type:

  % rake

And see all the tasks.

T.
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-04-27 13:54
(Received via mailing list)
On Apr 27, 2006, at 6:17 AM, TRANS wrote:

> Hi,
>
> Is it possible to make the default task the same as using the -T
> option? I.e. I want to type:
>
>   % rake
>
> And see all the tasks.

I assume you could make a task that shells out to rake -T.

James Edward Gray II
45196398e9685000d195ec626d477f0e?d=identicon&s=25 Trans (Guest)
on 2006-04-27 14:26
(Received via mailing list)
James Edward Gray II <james <at> grayproductions.net> writes:

> > And see all the tasks.
>
> I assume you could make a task that shells out to rake -T.

Thanks, James. Turns out that doesn't work so well. But your suggestion
spark an
idea and I and figured out a way:

  task :default => [:tasks]

  task :tasks do
    Rake.application.display_tasks_and_comments
  end

T.
A87f7a014c624587fab0d3d78c5b9c18?d=identicon&s=25 Bil Kleb (Guest)
on 2006-04-27 15:04
(Received via mailing list)
Trans wrote:
>
>   task :default => [:tasks]
>
>   task :tasks do
>     Rake.application.display_tasks_and_comments
>   end

This doesn't work for me, viz,

  $ rake
  (in /Users/kleb)
  $
893c38bd5f182afc751540657d8aacf7?d=identicon&s=25 Stefano Taschini (Guest)
on 2006-04-27 15:06
(Received via mailing list)
Apparently, with rake 0.7.1 you also need to set the regexp filtering
the tasks:

 task :tasks do
   Rake.application.options.show_task_pattern = //
   Rake.application.display_tasks_and_comments
 end

Ciao
Stefano


On 27/04/06, Trans <transfire@gmail.com> wrote:
[...]
A87f7a014c624587fab0d3d78c5b9c18?d=identicon&s=25 Bil Kleb (Guest)
on 2006-04-27 18:16
(Received via mailing list)
Stefano Taschini wrote:
> Apparently, with rake 0.7.1 you also need to set the regexp filtering the tasks:
>
>  task :tasks do
>    Rake.application.options.show_task_pattern = //
>    Rake.application.display_tasks_and_comments
>  end

Works for me now.

Thanks,
This topic is locked and can not be replied to.