Skip to content

Instantly share code, notes, and snippets.

@jmettraux
Created June 14, 2013 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmettraux/5785570 to your computer and use it in GitHub Desktop.
Save jmettraux/5785570 to your computer and use it in GitHub Desktop.
# 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