[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to invoke a rake file

Thufir Hawat

3/25/2008 4:31:00 AM

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-rak...

thanks,

Thufir

6 Answers

Michael Fellinger

3/25/2008 5:30:00 AM

0

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-rak...

[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-rak...

Mark Ryall

3/25/2008 9:54:00 AM

0

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

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-rak...
>
> thanks,
>
> Thufir
>
>

Thufir Hawat

3/26/2008 3:45:00 AM

0

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 :(


-Thufir

Thufir Hawat

3/26/2008 3:52:00 AM

0

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
[...]

Thanks, this worked on Windows :)


Why isn't it:

rake utils:create_directory


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




thanks,

Thufir

Michael Fellinger

3/26/2008 3:57:00 AM

0

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 :(

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

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

^ manveru

Thufir Hawat

3/27/2008 10:03:00 AM

0

On Mar 25, 8:56 pm, Michael Fellinger <m.fellin...@gmail.com> wrote:
[...]
> "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