I've created a very small application in rails where I've created a module method in /lib to handle the logic.
I've also set up Whenever to run that Module Method at set times. I've followed both the readme from Whenever and these previous posts to hopefully set things up correctly.
When looking at the readme though the examples are quoted like this:
every 3.hours do
runner "MyModel.some_process"
rake "my:rake:task"
command "/usr/bin/my_great_command"
end
every 1.day, :at => '4:30 am' do
runner "MyModel.task_to_run_at_four_thirty_in_the_morning"
end
every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot
runner "SomeModel.ladeeda"
end
My question therefore is does whenever have to reference a method in the model? or can it reference a module method in /lib? Looking at this post it seems to allude to having to have the method in the model.
My problem is that I don't have a database and so no models.
Any help would be appreciated.