Adam Salter | 19 Jun 2008 11:01
Picon
Gravatar

~/.rake file?

Hey all,
Just wanted to run this by the list....
Is anybody adverse to me implementing basic 'sake' functionality?
sake is a system-wide rake, and basically just reads the rake tasks  
from ~/.sake (ok - it does a fair bit more - sorry Chris for  
denegrating your good work! ;)

I suggest having a (optional) ~/.rake which is only read if no other  
rake file is found (or a command line option is added).

This means you could have rake tasks for general stuff.
E.g.
rake system:clean_temp_files

Sake implements a lot of other functionality, reading tasks from  
websites, internal server for serving tasks, but the basic  
functionality could be a good fit for pulling into rake.

Want to run this by the list before I get started, so I don't  
implement and find that it's rejected.

Best,
-Adam
James Tucker | 19 Jun 2008 11:22
Picon
Gravatar

Re: ~/.rake file?

chroot to ~, or put Rakefile in / also works...

As much as I'd like sake with less overhead, i think this already  
works in some fashion, except for across drives on win32.

On 19 Jun 2008, at 10:01, Adam Salter wrote:

> Hey all,
> Just wanted to run this by the list....
> Is anybody adverse to me implementing basic 'sake' functionality?
> sake is a system-wide rake, and basically just reads the rake tasks  
> from ~/.sake (ok - it does a fair bit more - sorry Chris for  
> denegrating your good work! ;)
>
> I suggest having a (optional) ~/.rake which is only read if no other  
> rake file is found (or a command line option is added).
>
> This means you could have rake tasks for general stuff.
> E.g.
> rake system:clean_temp_files
>
> Sake implements a lot of other functionality, reading tasks from  
> websites, internal server for serving tasks, but the basic  
> functionality could be a good fit for pulling into rake.
>
> Want to run this by the list before I get started, so I don't  
> implement and find that it's rejected.
>
> Best,
> -Adam
(Continue reading)

Pp Junty | 25 Jun 2008 22:41
Picon

'rake db:create' gives "Unknown database" in rails 2.1

the task rake db:create stopped working since i updated rails
from 2.0 to 2.1.0. the problem is that now
rake is loading the files in the 'config/initializers' directory,
and one of the files has database operations, so as the database
is not created yet the 'db:create' task halts. i commented
the db calls and the database was created normally.
i checked the rake version and apparently it's the same
in both rails versions (1.8.1). does anyone know how
to avoid this? thanks a lot.

ppjunty
Jim Weirich | 25 Jun 2008 22:53
Picon
Gravatar

Re: 'rake db:create' gives "Unknown database" in rails 2.1


On Jun 25, 2008, at 4:41 PM, Pp Junty wrote:

> the task rake db:create stopped working since i updated rails
> from 2.0 to 2.1.0. the problem is that now
> rake is loading the files in the 'config/initializers' directory,
> and one of the files has database operations, so as the database
> is not created yet the 'db:create' task halts. i commented
> the db calls and the database was created normally.
> i checked the rake version and apparently it's the same
> in both rails versions (1.8.1). does anyone know how
> to avoid this? thanks a lot.

Rake has no 'built-in' knowledge of rails or the 'config/initializers'  
directory.  Rake behavior in a rails project is completely controlled  
by the rake tasks supplied with Rails.  My guess is that this is more  
of a Rails issue than a rake-devel issue.

--

-- 
-- Jim Weirich
-- jim.weirich <at> gmail.com
Pp Junty | 25 Jun 2008 23:24
Picon

Re: 'rake db:create' gives "Unknown database" in rails 2.1

ok, thanks for the tip Jim, i'll check how rails is doing
this, and apparently it happens with 'db:migrate' as well
in other conditions. there is some talk about that at
http://www.ruby-forum.com/topic/154561.

>
> Rake has no 'built-in' knowledge of rails or the 'config/initializers'
> directory.  Rake behavior in a rails project is completely controlled by the
> rake tasks supplied with Rails.  My guess is that this is more of a Rails
> issue than a rake-devel issue.
>
> --
> -- Jim Weirich
> -- jim.weirich <at> gmail.com
>
>
>
>
> _______________________________________________
> Rake-devel mailing list
> Rake-devel <at> rubyforge.org
> http://rubyforge.org/mailman/listinfo/rake-devel
>
Adam Salter | 30 Jun 2008 06:41
Picon
Gravatar

Re: ~/.rake file?

chroot is not really the same thing... ie it's not really a standard  
or normal way of having Rake tasks globally available... ie I can't  
use it that way regularly.
Rakefile in / does work i guess, but makes me think when i said  
'globally available' i really meant 'per-user'.

Still no comment from the great and benevolent leader Jim... ;)

-Adam

On 19/06/2008, at 7:22 PM, James Tucker wrote:

> chroot to ~, or put Rakefile in / also works...
>
> As much as I'd like sake with less overhead, i think this already  
> works in some fashion, except for across drives on win32.
>
> On 19 Jun 2008, at 10:01, Adam Salter wrote:
>
>> Hey all,
>> Just wanted to run this by the list....
>> Is anybody adverse to me implementing basic 'sake' functionality?
>> sake is a system-wide rake, and basically just reads the rake tasks  
>> from ~/.sake (ok - it does a fair bit more - sorry Chris for  
>> denegrating your good work! ;)
>>
>> I suggest having a (optional) ~/.rake which is only read if no  
>> other rake file is found (or a command line option is added).
>>
>> This means you could have rake tasks for general stuff.
(Continue reading)

Jim Weirich | 30 Jun 2008 15:33
Picon
Gravatar

Re: ~/.rake file?


On Jun 30, 2008, at 12:41 AM, Adam Salter wrote:

> chroot is not really the same thing... ie it's not really a standard  
> or normal way of having Rake tasks globally available... ie I can't  
> use it that way regularly.
> Rakefile in / does work i guess, but makes me think when i said  
> 'globally available' i really meant 'per-user'.
>
> Still no comment from the great and benevolent leader Jim... ;)

You forgot the easily distractible :)

I have no strong objection to this change.  Several points:

(1) Only reads .rake if if finds no other Rakefile.  This is important  
because you don't want to accidently put important build functionality  
outside of your project directory.

(2) If the command line option is given, then the local Rakefile  
should be ignored.

(3) Where are you going to put the .rake file on a windows machine?

(4) Include tests for all changes.  I am much more likely to accept  
patches with tests than otherwise.

Also, I'm planning on putting a git repository of rake on github in  
the very near future (meant to do it this weekend but ran out of  
time).  That should make it easier for alternate versions.  I'll put  
(Continue reading)

Luis Lavena | 30 Jun 2008 15:53
Picon
Gravatar

Re: ~/.rake file?

Sorry I came late to this topic...

On Mon, Jun 30, 2008 at 3:33 PM, Jim Weirich <jim.weirich <at> gmail.com> wrote:
>
> On Jun 30, 2008, at 12:41 AM, Adam Salter wrote:
>
>> chroot is not really the same thing... ie it's not really a standard or
>> normal way of having Rake tasks globally available... ie I can't use it that
>> way regularly.
>> Rakefile in / does work i guess, but makes me think when i said 'globally
>> available' i really meant 'per-user'.
>>
>> Still no comment from the great and benevolent leader Jim... ;)
>
> You forgot the easily distractible :)
>
> I have no strong objection to this change.  Several points:
>
> (1) Only reads .rake if if finds no other Rakefile.  This is important
> because you don't want to accidently put important build functionality
> outside of your project directory.
>

Good, something like Sake does, you put generic tasks that you usualy
run for most of your projects (like log:clear) :-)

> (2) If the command line option is given, then the local Rakefile should be
> ignored.
>
> (3) Where are you going to put the .rake file on a windows machine?
(Continue reading)


Gmane