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
Instance Attribute Summary collapse
-
#build_config ⇒ Object
readonly
Returns the value of attribute build_config.
-
#build_targets ⇒ Object
readonly
Returns the value of attribute build_targets.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
-
.find_in_path(parent, path) ⇒ Array<Scheme>
Parse all the scheme files that can be found at the given path.
-
.find_in_project(project) ⇒ Object
Parse all the schemes given the current project.
-
.find_in_workspace(workspace) ⇒ Object
Parse all the schemes given the current workspace.
Instance Method Summary collapse
-
#builder ⇒ Object
Returns a builder for building this scheme.
-
#initialize(params = {}) ⇒ Scheme
constructor
A new instance of Scheme.
Constructor Details
#initialize(params = {}) ⇒ Scheme
Returns a new instance of Scheme.
47 48 49 50 51 52 53 54 55 |
# File 'lib/xcode/scheme.rb', line 47 def initialize(params={}) @parent = params[:parent] @path = File. params[:path] @root = File.(File.join(params[:root],'..')) @name = File.basename(path).gsub(/\.xcscheme$/,'') doc = Nokogiri::XML(open(@path)) parse_build_actions(doc) end |
Instance Attribute Details
#build_config ⇒ Object (readonly)
Returns the value of attribute build_config.
8 9 10 |
# File 'lib/xcode/scheme.rb', line 8 def build_config @build_config end |
#build_targets ⇒ Object (readonly)
Returns the value of attribute build_targets.
8 9 10 |
# File 'lib/xcode/scheme.rb', line 8 def build_targets @build_targets end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/xcode/scheme.rb', line 8 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
8 9 10 |
# File 'lib/xcode/scheme.rb', line 8 def parent @parent end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/xcode/scheme.rb', line 8 def path @path end |
Class Method Details
.find_in_path(parent, path) ⇒ Array<Scheme>
Parse all the scheme files that can be found at the given path. 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.
41 42 43 44 45 |
# File 'lib/xcode/scheme.rb', line 41 def self.find_in_path(parent, path) all_schemes_paths(path).map do |scheme_path| Xcode::Scheme.new(parent: parent, root: path, path: scheme_path) end end |
.find_in_project(project) ⇒ Object
Parse all the schemes given the current project.
13 14 15 |
# File 'lib/xcode/scheme.rb', line 13 def self.find_in_project(project) find_in_path(project, project.path) end |
.find_in_workspace(workspace) ⇒ Object
Parse all the schemes given the current workspace.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/xcode/scheme.rb', line 20 def self.find_in_workspace(workspace) schemes = find_in_path(workspace, workspace.path) # Project level schemes workspace.projects.each do |project| schemes+=project.schemes end schemes end |
Instance Method Details
#builder ⇒ Object
Returns a builder for building this scheme
58 59 60 |
# File 'lib/xcode/scheme.rb', line 58 def builder Xcode::Builder::SchemeBuilder.new(self) end |