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
# File 'lib/baleen/task/base.rb', line 6

def initialize
  @params = {}
  @params[:klass]          = self.class.to_s
  @params[:work_dir]       = nil
  @params[:files]          = nil
  @params[:bin]            = nil
  @params[:options]        = 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



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

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

#command=(c) ⇒ Object



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

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

#commandsObject



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

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

#respondObject



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

def respond
  nil
end

#resultObject



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

def result
  @params[:results]
end

#terminate?Boolean

Returns:

  • (Boolean)


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

def terminate?
  true
end