How to invoke a rake file

How is this rakefile invoked?

C:\code>
C:\code>rake
(in C:/code)
rake aborted!
Don't know how to build task 'default'

(See full trace by running task with --trace)

C:\code>
C:\code>type rakefile.rb
alias :original_directory :directory
def directory(dir)
   original_directory dir
   Rake::Task[dir]
end

namespace :utils do
   task :create_directories => [
      directory('public/icons'),
      directory('public/images'),
      directory('public/groups'),
   ]
end
C:\code>

from:
http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial

thanks,

Thufir

[snip]
If I wanted to use Rake to call each of these tasks, I might create a
file called "Rakefile"
[/snip]
from:
http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial

···

On Tue, Mar 25, 2008 at 1:30 PM, Thufir <hawat.thufir@gmail.com> wrote:

How is this rakefile invoked?

C:\code>
C:\code>rake
(in C:/code)
rake aborted!
Don't know how to build task 'default'

(See full trace by running task with --trace)

C:\code>
C:\code>type rakefile.rb
alias :original_directory :directory
def directory(dir)
   original_directory dir
   Rake::Task[dir]
end

namespace :utils do
   task :create_directories => [
      directory('public/icons'),
      directory('public/images'),
      directory('public/groups'),
   ]
end
C:\code>

from:
http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial

try:
rake utils:create_directories

···

On Tue, Mar 25, 2008 at 3:30 PM, Thufir <hawat.thufir@gmail.com> wrote:

How is this rakefile invoked?

C:\code>
C:\code>rake
(in C:/code)
rake aborted!
Don't know how to build task 'default'

(See full trace by running task with --trace)

C:\code>
C:\code>type rakefile.rb
alias :original_directory :directory
def directory(dir)
  original_directory dir
  Rake::Task[dir]
end

namespace :utils do
  task :create_directories => [
     directory('public/icons'),
     directory('public/images'),
     directory('public/groups'),
  ]
end
C:\code>

from:
http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial

thanks,

Thufir

[...]

> C:\code>type rakefile.rb

[...]

If I wanted to use Rake to call each of these tasks, I might create a
file called "Rakefile"

[...]

It is :frowning:

-Thufir

···

On Mar 24, 9:30 pm, Michael Fellinger <m.fellin...@gmail.com> wrote:

[...]

Thanks, this worked on Windows :slight_smile:

Why isn't it:

rake utils:create_directory

I thought it was just rails that did magic with plurals.

thanks,

Thufir

···

On Mar 25, 1:54 am, Mark Ryall <mark.ry...@gmail.com> wrote:

[Note: parts of this message were removed to make it a legal post.]

try:
rake utils:create_directories

"rakefile.rb" == "Rakefile"
# false

it is?
And yeah, you gotta invoke a task like Mark says.

^ manveru

···

On Wed, Mar 26, 2008 at 12:44 PM, Thufir <hawat.thufir@gmail.com> wrote:

On Mar 24, 9:30 pm, Michael Fellinger <m.fellin...@gmail.com> wrote:
[...]

> > C:\code>type rakefile.rb
[...]

> If I wanted to use Rake to call each of these tasks, I might create a
> file called "Rakefile"
[...]

It is :frowning:

[...]

"rakefile.rb" == "Rakefile"
# false

[...]

On my system at least rakefile.rb == Rakefile for these purposes.
Isn't that the case, or what did you mean? However, I wonder what
happens when there's rakefile.rb, Rakefile.rb and Rakefile as well as
rakefile and "rake" is run...

thufir@arrakis:~$
thufir@arrakis:~$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,
Rakefile.rb)
/usr/lib/ruby/1.8/rake.rb:1840:in `load_rakefile'
(See full trace by running task with --trace)
thufir@arrakis:~$

-Thufir

···

On Mar 25, 8:56 pm, Michael Fellinger <m.fellin...@gmail.com> wrote: