Sha256: d32db7e49a7859e3169ffdf2db641a4ec228fb4763c2d7debbe1464707d2c84e
Contents?: true
Size: 844 Bytes
Versions: 29
Compression:
Stored size: 844 Bytes
Contents
# frozen_string_literal: true module ShopifyCLI module Theme module DevServer class ReloadMode MODES = [:"hot-reload", :"full-page", :off] class << self def default :"hot-reload" end def get!(mode) MODES.find { |m| m == mode.to_sym } || raise_error(mode) end private def raise_error(invalid_mode) error_message = ShopifyCLI::Context.message("theme.serve.reload_mode_is_not_valid", invalid_mode) help_message = ShopifyCLI::Context.message("theme.serve.try_a_valid_reload_mode", valid_modes) ShopifyCLI::Context.abort(error_message, help_message) end def valid_modes MODES.map { |v| "`#{v}`" }.join(", ") end end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems