Class: Bedouin::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/bedouin/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment, template) ⇒ Job

Returns a new instance of Job.



7
8
9
10
11
# File 'lib/bedouin/job.rb', line 7

def initialize(environment,template)
  @name = (template.name + '_' + environment.name).freeze
  @environment = environment
  @template = template
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/bedouin/job.rb', line 5

def name
  @name
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/bedouin/job.rb', line 4

def status
  @status
end

#stderrObject

Returns the value of attribute stderr.



4
5
6
# File 'lib/bedouin/job.rb', line 4

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



4
5
6
# File 'lib/bedouin/job.rb', line 4

def stdout
  @stdout
end

Instance Method Details

#file_pathObject



13
14
15
# File 'lib/bedouin/job.rb', line 13

def file_path
  tempfile.path
end

#to_sObject



17
18
19
20
21
22
23
# File 'lib/bedouin/job.rb', line 17

def to_s
  [stdout, stderr].map do |output|
    output.each_line.map do |l|
      @name + ": " + l
    end
  end
end