Sha256: ee0e23b4cb39e3cfe3d6391a5c954386c79b78798f96d8505a15776ce5ce2228

Contents?: true

Size: 785 Bytes

Versions: 22

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true

module ShopifyCLI
  module Theme
    class Syncer
      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

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
shopify-cli-2.29.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.28.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.27.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.26.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.25.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.24.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.23.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.22.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.21.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.20.1 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.20.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.19.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.18.1 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.18.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.17.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.16.1 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.16.0 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.15.6 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.15.5 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb
shopify-cli-2.15.4 lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb