Class: Defgen::XcodeprojAdapter
- Inherits:
-
Object
- Object
- Defgen::XcodeprojAdapter
- Defined in:
- lib/defgen/xcodeproj_adapter.rb
Instance Method Summary collapse
-
#initialize(proj, path) ⇒ XcodeprojAdapter
constructor
A new instance of XcodeprojAdapter.
- #main_group ⇒ Object
- #main_target ⇒ Object
- #name ⇒ Object
- #objects ⇒ Object
- #organization ⇒ Object
- #prefix ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(proj, path) ⇒ XcodeprojAdapter
Returns a new instance of XcodeprojAdapter.
5 6 7 |
# File 'lib/defgen/xcodeproj_adapter.rb', line 5 def initialize proj, path @proj, @path = proj, path end |
Instance Method Details
#main_group ⇒ Object
30 31 32 |
# File 'lib/defgen/xcodeproj_adapter.rb', line 30 def main_group root_object.main_group.groups.first end |
#main_target ⇒ Object
34 35 36 |
# File 'lib/defgen/xcodeproj_adapter.rb', line 34 def main_target root_object.targets.first end |
#name ⇒ Object
9 10 11 |
# File 'lib/defgen/xcodeproj_adapter.rb', line 9 def name @proj.targets.first.name end |
#objects ⇒ Object
22 23 24 |
# File 'lib/defgen/xcodeproj_adapter.rb', line 22 def objects @proj.objects end |
#organization ⇒ Object
26 27 28 |
# File 'lib/defgen/xcodeproj_adapter.rb', line 26 def organization root_object.attributes['ORGANIZATIONNAME'] end |
#prefix ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/defgen/xcodeproj_adapter.rb', line 13 def prefix prefix = root_object.attributes['CLASSPREFIX'] if prefix.nil? || prefix.empty? 'PS' else prefix.upcase end end |
#save ⇒ Object
38 39 40 |
# File 'lib/defgen/xcodeproj_adapter.rb', line 38 def save @proj.save_as @path end |