diff --git a/Gemfile b/Gemfile index 49f23a6..66b9a44 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,8 @@ gem 'hpricot' gem 'nokogiri' gem 'rake', :require => false +gem 'whenever', :require => false + # FIXME list here all actual dependencies (i.e. the ones in debian/control), # with their GEM names (not the Debian package names) diff --git a/Gemfile.lock b/Gemfile.lock index 518e712..d37d76c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,6 +46,7 @@ GEM xpath (~> 2.0) childprocess (0.3.3) ffi (~> 1.0.6) + chronic (0.10.2) cucumber (1.0.6) builder (>= 2.1.2) diff-lcs (>= 1.1.2) @@ -146,6 +147,9 @@ GEM polyglot (>= 0.3.1) tzinfo (0.3.33) websocket (1.0.7) + whenever (0.9.2) + activesupport (>= 2.3.4) + chronic (>= 0.6.3) will_paginate (3.0.3) xpath (2.0.0) nokogiri (~> 1.3) @@ -177,4 +181,5 @@ DEPENDENCIES ruby-feedparser selenium-webdriver thin + whenever will_paginate diff --git a/config/schedule.rb b/config/schedule.rb new file mode 100644 index 0000000..3654d0c --- /dev/null +++ b/config/schedule.rb @@ -0,0 +1,27 @@ +# Use this file to easily define all of your cron jobs. +# +# It's helpful, but not entirely necessary to understand cron before proceeding. +# http://en.wikipedia.org/wiki/Cron + +# Example: +# +# set :output, "/path/to/my/cron_log.log" +# +# every 2.hours do +# command "/usr/bin/some_great_command" +# runner "MyModel.some_method" +# rake "some:great:rake:task" +# end +# +# every 4.days do +# runner "AnotherModel.prune_old_records" +# end + +# Learn more: http://github.com/javan/whenever +# +set :environment, 'development' +set :output, "/home/rodrigo/noosfero/log/cron.log" + +every 1.minute do + runner "SearchTerm.calculate_scores" +end -- libgit2 0.21.2