Hi,

For new custom rack task you have to write rake file under the location
Project/lib/tasks/sample.rake

In that sample.rake file

desc "This task is back-end ruby script added for cron job"
task :cron => :environment do
# put some logic.
end

Go to your console put the command #> bundle exec rake -D

It will return rake tasks which are used in your project.

For example, here you will get your task

rake cron
This task is back-end ruby script added for cron job

Run it using #> bundle exec rake cron


andrea longhi wrote in post #1053442:
Hello,

I'm writing a nice gem which incorporate a few rake tasks, but I can't
find a way to add my custom tasks to the application rake list, if the
app is rails 2.x. I googled for a while but without any luck... any
hints?

Thanks

Andrea
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 26, '12 at 9:08p
activeMar 27, '12 at 6:56a
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Andrea longhi: 1 post Prabu Duraisamy: 1 post

People

Translate

site design / logo © 2022 Grokbase