Sha256: 3a5a557d5d6d4833b51deb3557685b0a9714429a4af00df718c630b845916f21

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 Bytes

Contents

require_relative "../cocoapods-binary-cache/helper/json"

module PodPrebuild
  class Config
    attr_reader :cache_repo, :cache_path, :prebuild_path, :prebuild_delta_path

    def initialize(path)
      @data = PodPrebuild::JSONFile.new(path)
      @cache_repo = @data["cache_repo"] || @data["prebuilt_cache_repo"]
      @cache_path = File.expand_path(@data["cache_path"])
      @prebuild_path = @data["prebuild_path"] || "_Prebuild"
      @prebuild_delta_path = @data["prebuild_delta_path"] || "_Prebuild_delta/changes.json"
    end

    def self.instance
      @instance ||= new("PodBinaryCacheConfig.json")
    end

    def manifest_path(in_cache: false)
      root_dir(in_cache) + "/Manifest.lock"
    end

    def root_dir(in_cache)
      in_cache ? @cache_path : @prebuild_path
    end

    def generated_frameworks_dir(in_cache: false)
      root_dir(in_cache) + "/GeneratedFrameworks"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cocoapods-binary-cache-0.1.6 lib/command/config.rb
cocoapods-binary-cache-0.1.5 lib/command/config.rb