Sha256: 02ee342a2a115450f40e9329cbf6fe0aa7a291ec83116bee695b3d0c4b2db1b6

Contents?: true

Size: 456 Bytes

Versions: 47

Compression:

Stored size: 456 Bytes

Contents

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

      def progress(method, **args)
        @syncer.lock_io!
        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.unlock_io!
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.35.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.34.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.33.1 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.33.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.32.1 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.32.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.31.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.30.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.29.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.28.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.27.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.26.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.25.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.24.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.23.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.22.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.21.0 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.20.1 lib/project_types/theme/ui/sync_progress_bar.rb
shopify-cli-2.20.0 lib/project_types/theme/ui/sync_progress_bar.rb