Class: Updater::Chained

Inherits:
Object
  • Object
show all
Defined in:
lib/updater/chained.rb

Class Method Summary collapse

Class Method Details

.__resetObject



23
24
25
26
# File 'lib/updater/chained.rb', line 23

def __reset
  @jobs = nil
  @args_for == {}
end

.jobs(name) ⇒ Object



4
5
6
7
8
# File 'lib/updater/chained.rb', line 4

def jobs(name)
  name = name.to_s
  @jobs ||= Hash.new {|_,n| find_or_create(n)}
  @jobs[name]
end

.reschedule(job, options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/updater/chained.rb', line 10

def reschedule(job,options)
  new_time = options[:at] || Update.time.now + options[:in]
  Update.at(
    new_time,job.target,job.method,job.method_args,
    :finder=>job.finder,
    :finder_args=>job.finder_args,
    :name=>job.name,
    :success=>job.success - [jobs(:reschedule)],
    :failure=>job.failure - [jobs(:reschedule)],
    :ensure=>job.ensure - [jobs(:reschedule)]
  )
end