lib/command/executor/prebuilder.rb in cocoapods-binary-cache-0.1.9 vs lib/command/executor/prebuilder.rb in cocoapods-binary-cache-0.1.10
- old
+ new
@@ -2,26 +2,26 @@
require_relative "fetcher"
require_relative "pusher"
module PodPrebuild
class CachePrebuilder < CommandExecutor
+ attr_reader :repo_update, :fetcher, :pusher
+
def initialize(options)
super(options)
- @cache_branch = options[:cache_branch]
- @push_cache = options[:push_cache]
@repo_update = options[:repo_update]
- @fetcher = PodPrebuild::CacheFetcher.new(options)
- @pusher = PodPrebuild::CachePusher.new(options)
+ @fetcher = PodPrebuild::CacheFetcher.new(options) unless options[:no_fetch]
+ @pusher = PodPrebuild::CachePusher.new(options) if options[:push_cache]
end
def run
- @fetcher.run
+ @fetcher&.run
prebuild
changes = PodPrebuild::JSONFile.new(@config.prebuild_delta_path)
return if changes.empty?
sync_cache(changes)
- @pusher.run if @push_cache
+ @pusher&.run
end
private
def prebuild