Class: Xcode::Scheme

Inherits:
Object
  • Object
show all
Defined in:
lib/xcode/scheme.rb

Overview

Schemes are an XML file that describe build, test, launch and profile actions For the purposes of Xcoder, we want to be able to build and test The scheme’s build action only describes a target, so we need to look at launch for the config

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, path) ⇒ Scheme

Returns a new instance of Scheme.



10
11
12
13
14
15
16
17
18
# File 'lib/xcode/scheme.rb', line 10

def initialize(project, path)
  @project = project
  @path = File.expand_path(path)
  @name = File.basename(path).gsub(/\.xcscheme$/,'')
  doc = Nokogiri::XML(open(@path))
  
  @launch = parse_action(doc, 'launch')
  @test = parse_action(doc, 'test')
end

Instance Attribute Details

#launchObject (readonly)

Returns the value of attribute launch.



9
10
11
# File 'lib/xcode/scheme.rb', line 9

def launch
  @launch
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/xcode/scheme.rb', line 9

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/xcode/scheme.rb', line 9

def path
  @path
end

#projectObject (readonly)

Returns the value of attribute project.



9
10
11
# File 'lib/xcode/scheme.rb', line 9

def project
  @project
end

#testObject (readonly)

Returns the value of attribute test.



9
10
11
# File 'lib/xcode/scheme.rb', line 9

def test
  @test
end

Instance Method Details

#builderObject



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

def builder
  Xcode::Builder.new(self)
end