diff --git a/Gemfile b/Gemfile index 5d86c688..a63fe982 100644 --- a/Gemfile +++ b/Gemfile @@ -37,6 +37,7 @@ gem 'acts_as_versioned', git: 'git://github.com/technoweenie/acts_as_versioned.g gem 'acts_as_tree' gem 'acts_as_configurable', git: 'git://github.com/bwalding/acts_as_configurable.git' gem 'resque' +gem 'whenever', :require => false # For defining cronjobs, see config/schedule.rb group :production do gem 'exception_notification', :require => 'exception_notifier' diff --git a/Gemfile.lock b/Gemfile.lock index 8a03a2a1..68e31d2d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,6 +57,7 @@ GEM erubis (>= 2.7.0) binding_of_caller (0.6.8) builder (3.0.4) + chronic (0.9.0) client_side_validations (3.1.4) coderay (1.0.8) coffee-rails (3.2.2) @@ -111,7 +112,7 @@ GEM activesupport (~> 3.1) polyamorous (~> 0.5.0) mime-types (1.19) - multi_json (1.3.7) + multi_json (1.5.0) mysql2 (0.3.11) pdf-reader (1.2.0) Ascii85 (~> 1.0.0) @@ -206,6 +207,9 @@ GEM multi_json (~> 1.0, >= 1.0.2) vegas (0.1.11) rack (>= 1.0.0) + whenever (0.8.1) + activesupport (>= 2.3.4) + chronic (>= 0.6.3) wikicloth (0.8.0) builder expression_parser @@ -244,4 +248,5 @@ DEPENDENCIES therubyracer twitter-bootstrap-rails uglifier (>= 1.0.3) + whenever wikicloth diff --git a/config/schedule.rb b/config/schedule.rb new file mode 100644 index 00000000..631e3d28 --- /dev/null +++ b/config/schedule.rb @@ -0,0 +1,15 @@ +# Use this file to define all tasks, which should be executed by cron +# Learn more: http://github.com/javan/whenever + +# Upcoming tasks notifier +every :day, :at => '7:20 am' do + rake "multicoops:run foodsoft:notify_upcoming_tasks" +end + +# Weekly taks +every :sunday, :at => '7:14 am' do + rake "multicoops:run foodsoft:create_upcoming_weekly_tasks" + rake "multicoops:run foodsoft:notify_users_of_weekly_task" +end + +