class RBCM::ActionList

Public Class Methods

new(array=[]) click to toggle source
# File app/action/list.rb, line 2
def initialize array=[]
  array.each do |element|
    insert -1, element
  end
end

Public Instance Methods

applied() click to toggle source
# File app/action/list.rb, line 57
def applied
  RBCM::ActionList.new select.applied?
end
applyable() click to toggle source
# File app/action/list.rb, line 53
def applyable
  RBCM::ActionList.new select.applyable?
end
approvable() click to toggle source
# File app/action/list.rb, line 45
def approvable
  RBCM::ActionList.new select.approvable?
end
approved() click to toggle source
# File app/action/list.rb, line 49
def approved
  RBCM::ActionList.new select.approved?
end
checkable() click to toggle source
# File app/action/list.rb, line 33
def checkable
  RBCM::ActionList.new select.checkable?
end
failed() click to toggle source
# File app/action/list.rb, line 65
def failed
  RBCM::ActionList.new applied.select.failed?
end
file(path) click to toggle source
# File app/action/list.rb, line 24
def file path
  RBCM::ActionList.new select{|action| action.path == path}
end
neccessary() click to toggle source
# File app/action/list.rb, line 41
def neccessary
  RBCM::ActionList.new select.neccessary?
end
node(node_name) click to toggle source
# File app/action/list.rb, line 28
def node node_name
  return self unless node_name
  RBCM::ActionList.new select{|action| action.job.node.name == node_name}
end
resolve_dependencies() click to toggle source
# File app/action/list.rb, line 8
def resolve_dependencies
  @actions = []
  self.each do |action|
    resolve_action_dependencies action
  end
  RBCM::ActionList.new @actions
end
resolve_triggers() click to toggle source
# File app/action/list.rb, line 16
def resolve_triggers
  @actions = []
  self.each do |action|
    resolve_action_triggers action
  end
  RBCM::ActionList.new @actions
end
succeeded() click to toggle source
# File app/action/list.rb, line 61
def succeeded
  RBCM::ActionList.new applied.select.succeeded?
end
unneccessary() click to toggle source
# File app/action/list.rb, line 37
def unneccessary
  RBCM::ActionList.new (self - neccessary)
end

Private Instance Methods

resolve_action_dependencies(this) click to toggle source
# File app/action/list.rb, line 71
def resolve_action_dependencies this
  self.select{ |action|
    this.dependencies.include? action.job.capability
  }.each{ |action|
    resolve_action_dependencies action
  }
  @actions << this unless @actions.include? this
end
resolve_action_triggers(this) click to toggle source
# File app/action/list.rb, line 80
def resolve_action_triggers this
  self.select{ |action|
    this.trigger.one?{|trigger| action.triggered_by.include? trigger}
  }.each{ |action|
    resolve_action_triggers action
  }
  @actions << this unless @actions.include? this
end