Class: Samus::BuildAction

Inherits:
Action
  • Object
show all
Defined in:
lib/samus/build_action.rb

Instance Attribute Summary collapse

Attributes inherited from Action

#files

Instance Method Summary collapse

Methods inherited from Action

#action=, #allowFail=, #arguments=, #credentials=, #load

Constructor Details

#initialize(opts = {}) ⇒ BuildAction

Returns a new instance of BuildAction.



5
6
7
8
9
# File 'lib/samus/build_action.rb', line 5

def initialize(opts = {})
  super(opts)
  @pwd = nil
  @skip = false
end

Instance Attribute Details

#publishObject

Returns the value of attribute publish.



11
12
13
# File 'lib/samus/build_action.rb', line 11

def publish
  @publish
end

#pwd=(value) ⇒ Object (writeonly)

Sets the attribute pwd

Parameters:

  • value

    the value to set the attribute pwd to.



21
22
23
# File 'lib/samus/build_action.rb', line 21

def pwd=(value)
  @pwd = value
end

#skipObject (readonly)

Returns the value of attribute skip.



35
36
37
# File 'lib/samus/build_action.rb', line 35

def skip
  @skip
end

Instance Method Details

#command_optionsObject



17
18
19
# File 'lib/samus/build_action.rb', line 17

def command_options
  super.merge(pwd: @pwd)
end

#condition=(condition) ⇒ Object



36
37
38
39
40
41
# File 'lib/samus/build_action.rb', line 36

def condition=(condition)
  @skip = !eval(condition)
rescue StandardError => e
  puts "[E] Condition failed on #{@raw_options['action']}"
  raise e
end

#runObject



23
24
25
26
# File 'lib/samus/build_action.rb', line 23

def run
  return if @skip
  super
end

#stageObject



13
14
15
# File 'lib/samus/build_action.rb', line 13

def stage
  'build'
end