Sha256: 822f2fb75ba6ad5da0da6aacf0195aa4cd3bd85971299fcadc8938a93dfdbd31

Contents?: true

Size: 557 Bytes

Versions: 11

Compression:

Stored size: 557 Bytes

Contents

module Xcode
  class Target
    attr_reader :configs, :project
    
    def initialize(project, json)
      @project = project
      @json = json
      @configs = []
    end
    
    def productName
      @json['productName']
    end
    
    def name
      @json['name']
    end
    
    def config(name)
      config = @configs.select {|c| c.name == name.to_s}.first
      raise "No such config #{name}, available configs are #{@configs.map {|c| c.name}.join(', ')}" if config.nil?
      yield config if block_given?
      config
    end
    
  end
  
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
xcoder-0.0.21 lib/xcode/target.rb
xcoder-0.0.20 lib/xcode/target.rb
xcoder-0.0.19 lib/xcode/target.rb
xcoder-0.0.18 lib/xcode/target.rb
xcoder-0.0.17 lib/xcode/target.rb
xcoder-0.0.16 lib/xcode/target.rb
xcoder-0.0.15 lib/xcode/target.rb
xcoder-0.0.14 lib/xcode/target.rb
xcoder-0.0.12 lib/xcode/target.rb
xcoder-0.0.11 lib/xcode/target.rb
xcoder-0.0.10 lib/xcode/target.rb