Class: Xcode::Scheme
- Inherits:
-
Object
- Object
- Xcode::Scheme
- 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
-
#launch ⇒ Object
readonly
Returns the value of attribute launch.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
Class Method Summary collapse
-
.find_in_path(path) ⇒ Array<Scheme>
Parse all the scheme files that can be found in the given project or workspace.
Instance Method Summary collapse
-
#builder ⇒ Object
def project launch.target.project end.
-
#initialize(path) ⇒ Scheme
constructor
A new instance of Scheme.
Constructor Details
#initialize(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(path) @path = File.(path) @root = File. "#{@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
#launch ⇒ Object (readonly)
Returns the value of attribute launch.
9 10 11 |
# File 'lib/xcode/scheme.rb', line 9 def launch @launch end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/xcode/scheme.rb', line 9 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/xcode/scheme.rb', line 9 def path @path end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
9 10 11 |
# File 'lib/xcode/scheme.rb', line 9 def test @test end |
Class Method Details
.find_in_path(path) ⇒ Array<Scheme>
Parse all the scheme files that can be found in the given project or workspace. Schemes can be defined as shared schemes and then user specific schemes. Parsing the schemes will load the shared ones and then the current acting user’s schemes.
37 38 39 40 41 42 43 44 |
# File 'lib/xcode/scheme.rb', line 37 def self.find_in_path(path) shared_schemes = Dir["#{path}/xcshareddata/xcschemes/*.xcscheme"] user_specific_schemes = Dir["#{path}/xcuserdata/#{ENV['USER']}.xcuserdatad/xcschemes/*.xcscheme"] (shared_schemes + user_specific_schemes).map do |scheme| Xcode::Scheme.new(scheme) end end |