Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   rake finds & runs task, but doesn't show in --tasks list (http://www.velocityreviews.com/forums/t854189-rake-finds-and-runs-task-but-doesnt-show-in-tasks-list.html)

Hugh J. Devlin 11-15-2008 07:25 AM

rake finds & runs task, but doesn't show in --tasks list
 
hi, rake & ruby-talk newbie, a boy's 1st rake task, lib/tasks/load.rake:

namespace :load do
task :hello_world do |t|
puts 'hello, world!'
end
end

runs fine:

# rake load:hello_world
(in ... )
hello, world!

but it's a no-show in rake --tasks, which just shows the standard rails
tasks

the task is not listed even when rake is pointed directly at the rake file:

# rake -f lib/tasks/load.rake --tasks
(in ... )

w/ or w/o explicit namespace in rake file doesn't help it show up in
--tasks

rake 0.8.3, rails 2.1.1, ruby 1.8, fedora 9

what am i doing wrong? thanks in advance. sorry if this is a FAQ.

Hugh


Joe Swatosh 11-15-2008 07:34 AM

Re: rake finds & runs task, but doesn't show in --tasks list
 
Hi Hugh,

On Fri, Nov 14, 2008 at 11:25 PM, Hugh J. Devlin <hdevlin@ameritech.net> wrote:
> hi, rake & ruby-talk newbie, a boy's 1st rake task, lib/tasks/load.rake:
>
> namespace :load do


# try this:
desc "hello world"

> task :hello_world do |t|
> puts 'hello, world!'
> end
> end
>


Good luck,
--
Joe


Mohit Sindhwani 11-15-2008 07:39 AM

Re: rake finds & runs task, but doesn't show in --tasks list
 
Joe Swatosh wrote:
> Hi Hugh,
>
> On Fri, Nov 14, 2008 at 11:25 PM, Hugh J. Devlin <hdevlin@ameritech.net> wrote:
>
>> hi, rake & ruby-talk newbie, a boy's 1st rake task, lib/tasks/load.rake:
>>
>> namespace :load do
>>

>
> # try this:
> desc "hello world"
>
>
>> task :hello_world do |t|
>> puts 'hello, world!'
>> end
>> end
>>


I think this is good reading:
http://railsenvy.com/2007/6/11/ruby-...-rake-tutorial

Cheers,
Mohit.
11/15/2008 | 3:42 PM.




Hugh J. Devlin 11-16-2008 12:32 AM

Re: rake finds & runs task, but doesn't show in --tasks list
 
thanks, Joe! that did the trick

("Only tasks with descriptions will be displayed with the "-T" switch. "
- missed that)

Joe Swatosh wrote:
> # try this:
> desc "hello world




All times are GMT. The time now is 05:23 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57