Class: PodPrebuild::CachePrebuilder

Inherits:
CommandExecutor show all
Defined in:
lib/command/executor/prebuilder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CommandExecutor

#git, #git_clone, #installer, #prepare_cache_dir, #use_local_cache?

Constructor Details

#initialize(options) ⇒ CachePrebuilder

Returns a new instance of CachePrebuilder.



9
10
11
12
13
14
# File 'lib/command/executor/prebuilder.rb', line 9

def initialize(options)
  super(options)
  @repo_update = options[:repo_update]
  @fetcher = PodPrebuild::CacheFetcher.new(options) unless options[:no_fetch]
  @pusher = PodPrebuild::CachePusher.new(options) if options[:push_cache]
end

Instance Attribute Details

#fetcherObject (readonly)

Returns the value of attribute fetcher.



7
8
9
# File 'lib/command/executor/prebuilder.rb', line 7

def fetcher
  @fetcher
end

#pusherObject (readonly)

Returns the value of attribute pusher.



7
8
9
# File 'lib/command/executor/prebuilder.rb', line 7

def pusher
  @pusher
end

#repo_updateObject (readonly)

Returns the value of attribute repo_update.



7
8
9
# File 'lib/command/executor/prebuilder.rb', line 7

def repo_update
  @repo_update
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
# File 'lib/command/executor/prebuilder.rb', line 16

def run
  @fetcher&.run
  prebuild
  changes = PodPrebuild::JSONFile.new(@config.prebuild_delta_path)
  return if changes.empty?

  sync_cache(changes)
  @pusher&.run
end