Class: PodPrebuild::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/command/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Config

Returns a new instance of Config.



7
8
9
10
11
12
13
# File 'lib/command/config.rb', line 7

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

Instance Attribute Details

#cache_pathObject (readonly)

Returns the value of attribute cache_path.



5
6
7
# File 'lib/command/config.rb', line 5

def cache_path
  @cache_path
end

#cache_repoObject (readonly)

Returns the value of attribute cache_repo.



5
6
7
# File 'lib/command/config.rb', line 5

def cache_repo
  @cache_repo
end

#prebuild_delta_pathObject (readonly)

Returns the value of attribute prebuild_delta_path.



5
6
7
# File 'lib/command/config.rb', line 5

def prebuild_delta_path
  @prebuild_delta_path
end

#prebuild_pathObject (readonly)

Returns the value of attribute prebuild_path.



5
6
7
# File 'lib/command/config.rb', line 5

def prebuild_path
  @prebuild_path
end

Class Method Details

.instanceObject



15
16
17
# File 'lib/command/config.rb', line 15

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

Instance Method Details

#generated_frameworks_dir(in_cache: false) ⇒ Object



27
28
29
# File 'lib/command/config.rb', line 27

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

#manifest_path(in_cache: false) ⇒ Object



19
20
21
# File 'lib/command/config.rb', line 19

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

#root_dir(in_cache) ⇒ Object



23
24
25
# File 'lib/command/config.rb', line 23

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