class Xcodeproj::XCScheme::ExecutionAction


This class wraps the ExecutionAction node of a .xcscheme XML file

def action_content

Returns:
  • (SendEmailActionContent) -
  • (ShellScriptActionContent) -
def action_content
  case action_type
  when Constants::EXECUTION_ACTION_TYPE[:shell_script]
    ShellScriptActionContent.new(@xml_element.elements['ActionContent'])
  when Constants::EXECUTION_ACTION_TYPE[:send_email]
    SendEmailActionContent.new(@xml_element.elements['ActionContent'])
  else
    raise "[Xcodeproj] Invalid ActionType `#{action_type}`"
  end
end

def action_content=(value)

Parameters:
  • value (ShellScriptActionContent, SendEmailActionContent) --
def action_content=(value)
  raise "[Xcodeproj] Invalid ActionContent `#{value.class}` for " \
    "ActionType `#{action_type}`" unless valid_action_content?(value)
  @xml_element.delete_element('ActionContent')
  @xml_element.add_element(value.xml_element)
end

def action_type

Returns:
  • (String) -
def action_type
  @xml_element.attributes['ActionType']
end

def initialize(node = nil, action_type = nil)

Parameters:
  • action_type (Symbol) --
  • node (REXML::Element) --
def initialize(node = nil, action_type = nil)
  create_xml_element_with_fallback(node, 'ExecutionAction') do
    type = action_type || node.action_type
    raise "[Xcodeproj] Invalid ActionType `#{type}`" unless Constants::EXECUTION_ACTION_TYPE.keys.include?(type)
    @xml_element.attributes['ActionType'] = Constants::EXECUTION_ACTION_TYPE[type]
  end
end

def valid_action_content?(value)

Parameters:
  • value (ShellScriptActionContent, SendEmailActionContent) --

Returns:
  • (Bool) -
def valid_action_content?(value)
  case action_type
  when Constants::EXECUTION_ACTION_TYPE[:shell_script]
    value.is_a?(ShellScriptActionContent)
  when Constants::EXECUTION_ACTION_TYPE[:send_email]
    value.is_a?(SendEmailActionContent)
  else
    false
  end
end