Module Rufus::Scheduler

  1. lib/rufus/sc/jobqueues.rb
  2. lib/rufus/sc/jobs.rb
  3. lib/rufus/sc/scheduler.rb
  4. lib/rufus/scheduler.rb
  5. show all

Methods

public class

  1. is_cron_string
  2. start_new

Constants

VERSION = '2.0.0'   This gem’s version

Public class methods

is_cron_string (s)

Returns true if the given string seems to be a cron string.

[show source]
    # File lib/rufus/scheduler.rb, line 50
50:   def self.is_cron_string (s)
51: 
52:     s.match('.+ .+ .+ .+ .+') # well...
53:   end
start_new (opts={})

A quick way to get a scheduler up an running

require 'rubygems'
s = Rufus::Scheduler.start_new

If EventMachine is present and running will create an EmScheduler, else it will create a PlainScheduler instance.

[show source]
    # File lib/rufus/scheduler.rb, line 39
39:   def self.start_new (opts={})
40: 
41:     if defined?(EM) and EM.reactor_running?
42:       EmScheduler.start_new(opts)
43:     else
44:       PlainScheduler.start_new(opts)
45:     end
46:   end