Class: PodPrebuild::CachePrebuilder
- Inherits:
-
CommandExecutor
- Object
- CommandExecutor
- PodPrebuild::CachePrebuilder
- Defined in:
- lib/command/executor/prebuilder.rb
Instance Attribute Summary collapse
-
#fetcher ⇒ Object
readonly
Returns the value of attribute fetcher.
-
#pusher ⇒ Object
readonly
Returns the value of attribute pusher.
-
#repo_update ⇒ Object
readonly
Returns the value of attribute repo_update.
Instance Method Summary collapse
-
#initialize(options) ⇒ CachePrebuilder
constructor
A new instance of CachePrebuilder.
- #run ⇒ Object
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() super() @repo_update = [:repo_update] @fetcher = PodPrebuild::CacheFetcher.new() unless [:no_fetch] @pusher = PodPrebuild::CachePusher.new() if [:push_cache] end |
Instance Attribute Details
#fetcher ⇒ Object (readonly)
Returns the value of attribute fetcher.
7 8 9 |
# File 'lib/command/executor/prebuilder.rb', line 7 def fetcher @fetcher end |
#pusher ⇒ Object (readonly)
Returns the value of attribute pusher.
7 8 9 |
# File 'lib/command/executor/prebuilder.rb', line 7 def pusher @pusher end |
#repo_update ⇒ Object (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
#run ⇒ Object
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 |