Class: Xcodeproj::XCScheme::ShellScriptActionContent

Inherits:
XMLElementWrapper show all
Defined in:
lib/xcodeproj/scheme/shell_script_action_content.rb

Overview

This class wraps a ‘ActionContent’ node of type ‘Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction’ of a .xcscheme XML file

Instance Attribute Summary

Attributes inherited from XMLElementWrapper

#xml_element

Instance Method Summary collapse

Methods inherited from XMLElementWrapper

#to_s

Constructor Details

#initialize(node = nil) ⇒ ShellScriptActionContent

Returns a new instance of ShellScriptActionContent.

Parameters:

  • node (REXML::Element) (defaults to: nil)

    The ‘ActionContent’ XML node that this object will wrap. If nil, will create a default XML node to use.



11
12
13
14
15
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 11

def initialize(node = nil)
  create_xml_element_with_fallback(node, 'ActionContent') do
    self.title = 'Run Script'
  end
end

Instance Method Details

#buildable_referenceBuildableReference

Returns The BuildableReference (Xcode target) associated with this ActionContent.

Returns:

  • (BuildableReference)

    The BuildableReference (Xcode target) associated with this ActionContent



62
63
64
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 62

def buildable_reference
  BuildableReference.new(@xml_element.elements['EnvironmentBuildable'].elements['BuildableReference'])
end

#buildable_reference=(ref) ⇒ Object

Parameters:

  • ref (BuildableReference)

    Set the BuildableReference (Xcode target) associated with this ActionContent



69
70
71
72
73
74
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 69

def buildable_reference=(ref)
  @xml_element.delete_element('EnvironmentBuildable')

  env_buildable = @xml_element.add_element('EnvironmentBuildable')
  env_buildable.add_element(ref.xml_element)
end

#script_textString

Returns The contents of the shell script represented by this ActionContent.

Returns:

  • (String)

    The contents of the shell script represented by this ActionContent



34
35
36
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 34

def script_text
  @xml_element.attributes['scriptText']
end

#script_text=(value) ⇒ Object

Parameters:

  • value (String)

    Set the contents of the shell script represented by this ActionContent



41
42
43
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 41

def script_text=(value)
  @xml_element.attributes['scriptText'] = value
end

#shell_to_invokeString

Returns The preferred shell to invoke with this ActionContent.

Returns:

  • (String)

    The preferred shell to invoke with this ActionContent



48
49
50
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 48

def shell_to_invoke
  @xml_element.attributes['shellToInvoke']
end

#shell_to_invoke=(value) ⇒ Object

Parameters:

  • value (String)

    Set the preferred shell to invoke with this ActionContent



55
56
57
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 55

def shell_to_invoke=(value)
  @xml_element.attributes['shellToInvoke'] = value
end

#titleString

Returns The title of this ActionContent.

Returns:

  • (String)

    The title of this ActionContent



20
21
22
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 20

def title
  @xml_element.attributes['title']
end

#title=(value) ⇒ Object

Parameters:

  • value (String)

    Set the title of this ActionContent



27
28
29
# File 'lib/xcodeproj/scheme/shell_script_action_content.rb', line 27

def title=(value)
  @xml_element.attributes['title'] = value
end