Class: PBXProjParser
- Inherits:
-
Object
- Object
- PBXProjParser
- Defined in:
- lib/ccios/pbxproj_parser.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
Returns the value of attribute project.
-
#source_path ⇒ Object
Returns the value of attribute source_path.
Instance Method Summary collapse
- #app_group ⇒ Object
- #classes_group ⇒ Object
- #coordinator_group ⇒ Object
- #core_group ⇒ Object
- #data_group ⇒ Object
-
#initialize(source_path) ⇒ PBXProjParser
constructor
A new instance of PBXProjParser.
- #interactor_group ⇒ Object
- #main_target ⇒ Object
- #project_path ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(source_path) ⇒ PBXProjParser
Returns a new instance of PBXProjParser.
7 8 9 10 11 12 13 |
# File 'lib/ccios/pbxproj_parser.rb', line 7 def initialize(source_path) @source_path = source_path if project_path.nil? raise "[Error] There is no xcodeproj at path #{@source_path}" end @project = Xcodeproj::Project.open(project_path) end |
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
5 6 7 |
# File 'lib/ccios/pbxproj_parser.rb', line 5 def project @project end |
#source_path ⇒ Object
Returns the value of attribute source_path.
5 6 7 |
# File 'lib/ccios/pbxproj_parser.rb', line 5 def source_path @source_path end |
Instance Method Details
#app_group ⇒ Object
27 28 29 |
# File 'lib/ccios/pbxproj_parser.rb', line 27 def app_group classes_group["App"] end |
#classes_group ⇒ Object
23 24 25 |
# File 'lib/ccios/pbxproj_parser.rb', line 23 def classes_group @project.groups.find { |g| g.display_name === "Classes" } end |
#coordinator_group ⇒ Object
35 36 37 |
# File 'lib/ccios/pbxproj_parser.rb', line 35 def coordinator_group classes_group["Coordinator"] end |
#core_group ⇒ Object
31 32 33 |
# File 'lib/ccios/pbxproj_parser.rb', line 31 def core_group classes_group["Core"] end |
#data_group ⇒ Object
43 44 45 |
# File 'lib/ccios/pbxproj_parser.rb', line 43 def data_group classes_group["Data"] end |
#interactor_group ⇒ Object
39 40 41 |
# File 'lib/ccios/pbxproj_parser.rb', line 39 def interactor_group core_group["Interactor"] end |
#main_target ⇒ Object
19 20 21 |
# File 'lib/ccios/pbxproj_parser.rb', line 19 def main_target @project.targets.first end |
#project_path ⇒ Object
15 16 17 |
# File 'lib/ccios/pbxproj_parser.rb', line 15 def project_path Dir.glob("#{@source_path}/*.xcodeproj").first end |
#save ⇒ Object
47 48 49 |
# File 'lib/ccios/pbxproj_parser.rb', line 47 def save @project.save end |