Class: ShopifyCLI::Theme::Syncer::Downloader
- Inherits:
-
Object
- Object
- ShopifyCLI::Theme::Syncer::Downloader
- Extended by:
- Forwardable
- Defined in:
- lib/shopify_cli/theme/syncer/downloader.rb
Instance Attribute Summary collapse
-
#ctx ⇒ Object
readonly
Returns the value of attribute ctx.
-
#syncer ⇒ Object
readonly
Returns the value of attribute syncer.
Instance Method Summary collapse
- #download! ⇒ Object
-
#initialize(syncer, delete, &update_progress_bar_block) ⇒ Downloader
constructor
A new instance of Downloader.
Constructor Details
#initialize(syncer, delete, &update_progress_bar_block) ⇒ Downloader
Returns a new instance of Downloader.
21 22 23 24 25 |
# File 'lib/shopify_cli/theme/syncer/downloader.rb', line 21 def initialize(syncer, delete, &) @syncer = syncer @delete = delete @update_progress_bar_block = end |
Instance Attribute Details
#ctx ⇒ Object (readonly)
Returns the value of attribute ctx.
11 12 13 |
# File 'lib/shopify_cli/theme/syncer/downloader.rb', line 11 def ctx @ctx end |
#syncer ⇒ Object (readonly)
Returns the value of attribute syncer.
11 12 13 |
# File 'lib/shopify_cli/theme/syncer/downloader.rb', line 11 def syncer @syncer end |
Instance Method Details
#download! ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/shopify_cli/theme/syncer/downloader.rb', line 27 def download! fetch_checksums! if delete_local_files? to_be_deleted.each { |file| delete(file) } end enqueue_get(checksums.keys) wait!(&@update_progress_bar_block) end |