Class: PodPrebuild::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Config

Returns a new instance of Config.



7
8
9
10
11
12
# 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"] || "Pods/_Prebuild"
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_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

Instance Method Details

#delta_file_pathObject



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

def delta_file_path
  # TODO (thuyen): Unify this path with PodPrebuild::Output#delta_file_path
  "Pods/_Prebuild_delta/changes.json"
end

#generated_frameworks_dir(in_cache: false) ⇒ Object



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

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

#manifest_path(in_cache: false) ⇒ Object



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

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

#root_dir(in_cache) ⇒ Object



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

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