Sha256: d82e48598d0c5b5051f065a5035e3e32470b724b949cc2c44117170d23edd99c

Contents?: true

Size: 858 Bytes

Versions: 9

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true

module ShopifyCLI
  module Theme
    class Syncer
      class Uploader
        module Forms
          class ApplyToAllForm < ShopifyCLI::Form
            attr_accessor :apply
            flag_arguments :number_of_files

            def ask
              title = message("title", number_of_files - 1)

              self.apply = CLI::UI::Prompt.ask(title, allow_empty: false) do |handler|
                handler.option(message("yes")) { true }
                handler.option(message("no")) { false }
              end

              self
            end

            def apply?
              apply
            end

            private

            def message(key, *params)
              ctx.message("theme.serve.syncer.forms.apply_to_all.#{key}", *params)
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb
shopify-cli-2.35.0 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb
shopify-cli-2.34.0 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb
shopify-cli-2.33.1 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb
shopify-cli-2.33.0 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb
shopify-cli-2.32.1 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb
shopify-cli-2.32.0 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb
shopify-cli-2.31.0 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb
shopify-cli-2.30.0 lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb