Created
June 14, 2013 21:50
-
-
Save jmettraux/5785570 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile | |
# | |
# ---8<--- | |
# source :rubygems | |
# | |
# gem 'yajl-ruby', :require => 'yajl' | |
# #gem 'ruote' | |
# gem 'ruote', :git => 'git://github.com/jmettraux/ruote.git' | |
# --->8--- | |
require 'ruote' | |
ruote = | |
Ruote::Dashboard.new( | |
Ruote::Worker.new( | |
Ruote::HashStorage.new('ruby_eval_allowed' => true))) | |
ruote.noisy = (ENV['NOISY'] == 'true') | |
# | |
# define process | |
# | |
#pdef = | |
# Ruote.define do | |
# cron '* * * * *' do | |
# echo '${r:Time.now.to_s} hello' | |
# end | |
# end | |
# | |
# too thin | |
pdef = | |
Ruote.define do | |
define 'intermittent_check' do | |
echo '${r:Time.now.to_s} is the door open? No? Good.' | |
end | |
cron '* * * * *' do | |
intermittent_check :forget => true | |
end | |
end | |
# | |
# slightly more convoluted | |
# | |
# run process | |
# | |
ruote.launch(pdef) | |
ruote.join |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment