Update rake task.

3 views
Skip to first unread message

eloy.d...@gmail.com

unread,
Feb 2, 2008, 11:55:53 AM2/2/08
to RubiGen
Hi,

I was wondering if there's already some way to be able to let
projects, that were created with rubigen,
check for files that aren't in the project yet but were added to the
project generator in newer gem versions.
Like the rails:update rake task in rails (or whatever it's called).

Cheers,
Eloy

eloy.d...@gmail.com

unread,
Feb 2, 2008, 12:02:14 PM2/2/08
to RubiGen
Actually now that I think about it,
I think that it should basically just run the same project generator
script again
and rubigen will figure out if a file exists or not and create it if
necessary.

So I don't know if it's something that should be in RubiGen at all...
I might just create a rake task which basically does:

task :update do
ruby "cd .. && rucola #{APPNAME}"
end

A simple test verifies that it would work,
or am I missing something?

Eloy

On Feb 2, 5:55 pm, "eloy.de.en...@gmail.com" <eloy.de.en...@gmail.com>
wrote:

eloy.d...@gmail.com

unread,
Feb 2, 2008, 12:07:14 PM2/2/08
to RubiGen
Err, obviously I mean to use "sh" instead of "ruby":

task :update do
sh "cd .. && rucola #{APPNAME}"
end

Anyways, there's only one problem with this.
Namely that for any file that you have modified since its creation
you'll be prompted if you want to overwrite the file.

Actually the only thing that you would probably want is that it
creates missing files.

Eloy

On Feb 2, 6:02 pm, "eloy.de.en...@gmail.com" <eloy.de.en...@gmail.com>
wrote:

Nic Williams

unread,
Feb 2, 2008, 3:41:25 PM2/2/08
to rub...@googlegroups.com
RubiGen is like the rails cmd - you can run it again on top of an existing app (or run an existing generator where you've already run it).

So inside your rucola app, you can run "rucola ."

The "." is the path; normally you'd do "rucola myapp" - what this does is create a myapp folder and set this as the path.

Let me know if this helps or not.

Nic

--
Dr Nic Williams
http://drnicacademy.com - Ruby/Rails training/dev around the world
http://drnicwilliams.com - Ruby/Rails/Javascript/Web2.0
(skype) nicwilliams
(p) +61 412 002 126 / +61 7 3113 3033
(mail) PO Box 583 Ashgrove 4060 QLD Aus

Eloy Duran

unread,
Feb 4, 2008, 2:39:20 PM2/4/08
to rub...@googlegroups.com
Hi Nic,

Yes indeed that works.
But I really would like it to just skip files that already exist instead
of asking me to overwrite them and only add files that are missing.
So is there a flag for skipping files except missing ones?

If not, than that's what I'll need to write :)

Thanks,
Eloy

Nic Williams

unread,
Feb 4, 2008, 4:10:19 PM2/4/08
to rub...@googlegroups.com
Not sure if there is a "skip all conflicts" option. I just can't remember.

Eloy Duran

unread,
Feb 5, 2008, 5:01:37 AM2/5/08
to rub...@googlegroups.com
I'll have a look at the source and/or add it.
Thanks again for your assistance,
Eloy
Reply all
Reply to author
Forward
0 new messages