Class: SGE::QStat::Parser

Inherits:
Nokogiri::XML::Document
  • Object
show all
Defined in:
lib/sge/qstat/parser.rb

Constant Summary collapse

XPATH_JOB_LIST =
'//job_list'
XPATH_PENDING =
'//job_list[@state="pending"]'
XPATH_RUNNING =
'//job_list[@state="running"]'
XPATH_SUSPENDED =
'//job_list[@state="suspended"]'

Instance Method Summary collapse

Instance Method Details

#jobsObject



15
16
17
# File 'lib/sge/qstat/parser.rb', line 15

def jobs
  @jobs ||=  xpath(XPATH_JOB_LIST)
end

#parse(*args) ⇒ Object



10
11
12
13
# File 'lib/sge/qstat/parser.rb', line 10

def parse(*args)
  reset!
  super
end

#pending_jobsObject



19
20
21
# File 'lib/sge/qstat/parser.rb', line 19

def pending_jobs
  @pending_jobs ||= xpath(XPATH_PENDING)
end

#reset!Object



31
32
33
34
35
# File 'lib/sge/qstat/parser.rb', line 31

def reset!
  @jobs = nil
  @running_jobs = nil
  @pending_jobs = nil
end

#running_jobsObject



23
24
25
# File 'lib/sge/qstat/parser.rb', line 23

def running_jobs
  @running_jobs ||=  xpath(XPATH_RUNNING)
end

#suspended_jobsObject



27
28
29
# File 'lib/sge/qstat/parser.rb', line 27

def suspended_jobs
  @suspended_jobs ||= xpath(XPATH_SUSPENDED)
end