Sha256: 47aee8d0b5f394285ed694858b794852401baf0390ee11856d3bfff748aab0a8

Contents?: true

Size: 775 Bytes

Versions: 2

Compression:

Stored size: 775 Bytes

Contents

require 'fspath'

module Xcode
  class Project
    class Config
      autoload :Decomment,  'xcode/project/config/decomment'
      autoload :IOScanner,  'xcode/project/config/io_scanner'
      autoload :ObjectNode, 'xcode/project/config/object_node'
      autoload :ArrayNode,  'xcode/project/config/array_node'

      attr_reader :path, :pbxproj_path, :root
      def initialize(path)
        @path = FSPath(path)
        @pbxproj_path = path / 'project.pbxproj'
        parse
      end

      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xcode-0.1.0 lib/xcode/project/config.rb
xcode-0.0.1 lib/xcode/project/config.rb