Sha256: b57a536c437abf960183684138703951e7431dd7a30794ab2ebdf6e5a4b88526

Contents?: true

Size: 619 Bytes

Versions: 45

Compression:

Stored size: 619 Bytes

Contents

# frozen_string_literal: true

module ShopifyCLI
  module Theme
    class Syncer
      ##
      # ShopifyCLI::Theme::Syncer::StdReporter allows disabling/enabling
      # messages reported in the standard output (ShopifyCLI::Context#puts).
      #
      class StandardReporter
        attr_reader :ctx

        def initialize(ctx)
          @enabled = true
          @ctx = ctx
        end

        def disable!
          @enabled = false
        end

        def enable!
          @enabled = true
        end

        def report(message)
          ctx.puts(message) if @enabled
        end
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
shopify-cli-2.34.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.33.1 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.33.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.32.1 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.32.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.31.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.30.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.29.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.28.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.27.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.26.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.25.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.24.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.23.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.22.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.21.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.20.1 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.20.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.19.0 lib/shopify_cli/theme/syncer/standard_reporter.rb
shopify-cli-2.18.1 lib/shopify_cli/theme/syncer/standard_reporter.rb