Class: Baleen::Task::Base

Inherits:
Object
  • Object
show all
Includes:
Serializable
Defined in:
lib/baleen/task/base.rb

Direct Known Subclasses

Cucumber, Generic, ImageUpdate, RunProject

Instance Method Summary collapse

Methods included from Serializable

deserialize, #dup, #method_missing, #params, symbolize_keys, #to_json

Constructor Details

#initializeBase

Returns a new instance of Base.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/baleen/task/base.rb', line 6

def initialize
  @params = {}
  @params[:klass]          = self.class.to_s
  @params[:shell]          = nil
  @params[:opt]            = nil
  @params[:work_dir]       = nil
  @params[:files]          = nil
  @params[:exe]            = nil
  @params[:concurrency]    = nil
  @params[:image]          = nil
  @params[:before_command] = nil
  @params[:command]        = nil
  @params[:results]        = nil
  @params[:status]         = nil
  @params[:commit]         = nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Baleen::Serializable

Instance Method Details

#commandObject



31
32
33
# File 'lib/baleen/task/base.rb', line 31

def command
  @params[:command] ||= %{#{@params[:exe]} #{@params[:files]}}
end

#command=(c) ⇒ Object



35
36
37
# File 'lib/baleen/task/base.rb', line 35

def command=(c)
  @params[:command] = c
end

#commandsObject



23
24
25
26
27
28
29
# File 'lib/baleen/task/base.rb', line 23

def commands
  %{
  #{@params[:before_command]}
      cd #{@params[:work_dir]}
  #{command}
  }
end

#respondObject



43
44
45
# File 'lib/baleen/task/base.rb', line 43

def respond
  nil
end

#resultObject



39
40
41
# File 'lib/baleen/task/base.rb', line 39

def result
  @params[:results]
end

#terminate?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/baleen/task/base.rb', line 47

def terminate?
  true
end