Class: PodPrebuild::CachePrebuilder

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

Instance Method Summary collapse

Methods inherited from CommandExecutor

#git, #git_clone

Constructor Details

#initialize(options) ⇒ CachePrebuilder

Returns a new instance of CachePrebuilder.



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

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

Instance Method Details

#runObject



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

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

  sync_cache(changes)
  @pusher.run if @push_cache
end