Class: Xcode::Project::Config
- Inherits:
-
Object
- Object
- Xcode::Project::Config
- Defined in:
- lib/xcode/project/config.rb,
lib/xcode/project/config/decomment.rb,
lib/xcode/project/config/array_node.rb,
lib/xcode/project/config/io_scanner.rb,
lib/xcode/project/config/object_node.rb
Defined Under Namespace
Modules: Decomment Classes: ArrayNode, IOScanner, ObjectNode
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#pbxproj_path ⇒ Object
readonly
Returns the value of attribute pbxproj_path.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(path) ⇒ Config
constructor
A new instance of Config.
- #parse ⇒ Object
Constructor Details
#initialize(path) ⇒ Config
Returns a new instance of Config.
10 11 12 13 14 |
# File 'lib/xcode/project/config.rb', line 10 def initialize(path) @path = Pathname(path) @pbxproj_path = path + 'project.pbxproj' parse end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/xcode/project/config.rb', line 9 def path @path end |
#pbxproj_path ⇒ Object (readonly)
Returns the value of attribute pbxproj_path.
9 10 11 |
# File 'lib/xcode/project/config.rb', line 9 def pbxproj_path @pbxproj_path end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
9 10 11 |
# File 'lib/xcode/project/config.rb', line 9 def root @root end |
Instance Method Details
#parse ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/xcode/project/config.rb', line 16 def parse @root = nil File.open(pbxproj_path) do |io| ios = IOScanner.new(io) token = ios.tokenize raise 'Unable to deserialize root object.' if token != ?{ @root = ObjectNode.new(io) end end |