javan/whenever — pull request #326 by 2called-chaos (2013-03-26 03:26:58+00:00)
Title: Allow more complex job types

Allow more complex job types by allowing blocks to be passed to `job_type` resp. `Whenever::Job.new`.

I came up with this because I needed to run multiple rake tasks in order and only if the previous command exited successfully. This would be possible with my PR:

```ruby
job_type :chained_rake do |options|
return if !options[:tasks] || options[:tasks].empty?
taskcmds = options[:tasks].map { |task| "bundle exec rake #{task} :output" }
"cd :path && export RAILS_ENV=:environment && " << taskcmd.join(" && ")
end
```

What do you think?