Sha256: 3eacc24608ae98e3a46b54245bea8460ca0afdf6be298c0299d2de168472ea4c

Contents?: true

Size: 465 Bytes

Versions: 19

Compression:

Stored size: 465 Bytes

Contents

module Theme
  module UI
    class SyncProgressBar
      def initialize(syncer)
        @syncer = syncer
      end

      def progress(method, **args)
        @syncer.delay_errors!
        CLI::UI::Progress.progress do |bar|
          @syncer.public_send(method, **args) do |left, total|
            bar.tick(set_percent: 1 - left.to_f / total)
          end
          bar.tick(set_percent: 1)
        end
        @syncer.report_errors!
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
shopify-cli-2.7.1 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.7.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.6.6 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.6.5 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.6.4 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.6.3 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.6.2 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.6.1 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.6.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.5.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.4.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.3.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.2.2 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.2.1 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.2.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.1.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.0.2 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.0.1 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.0.0 lib/project_types/theme/ui/sync_progress_bar.rb