Check the offical Github page of rufus-scheduler here: https://github.com/jmettraux/rufus-scheduler
require 'rubygems'
require 'sinatra'
require 'rufus/scheduler'
class App < Sinatra::Base
scheduler = Rufus::Scheduler.start_new
scheduler.every '5s' do
puts "task is running"
end
end
a = App.new
This puts the string on the console in every 5 seconds. You can replace that with your own code.