Class: DRYFT::Jobs

Inherits:
Object show all
Defined in:
lib/dryft/jobs.rb

Instance Method Summary collapse

Constructor Details

#initialize(db_file) ⇒ Jobs

Returns a new instance of Jobs.



4
5
6
7
8
# File 'lib/dryft/jobs.rb', line 4

def initialize(db_file)
  abort "ERROR: The specified WinAutomation jobs database does not exist: #{db_file}" if !File.exists?(db_file)
  @job_list = get_jobs(SQLite3::Database.new db_file)
  puts "Loaded the WinAutomation jobs database from: #{db_file}"
end

Instance Method Details

#by_id(id) ⇒ Object



10
11
12
# File 'lib/dryft/jobs.rb', line 10

def by_id(id)
  (@job_list.select{ |j| j.id == id }).first
end

#by_name(name) ⇒ Object



13
14
15
# File 'lib/dryft/jobs.rb', line 13

def by_name(name)
  (@job_list.select{ |j| j.name == name }).first
end

#by_proc(proc) ⇒ Object



16
17
18
# File 'lib/dryft/jobs.rb', line 16

def by_proc(proc)
  (@job_list.select{ |j| j.proc == proc }).first
end

#update_allObject



20
21
22
23
24
25
26
# File 'lib/dryft/jobs.rb', line 20

def update_all
  resolve_list(@job_list).each do |j|
    j.update_from_deps(self)      
  end
  puts "Updated all procedures.\n\n"
  puts "Please PRESS F5 in the WinAutomation Console to refresh the jobs list!"
end