Sha256: 38bb5c592b072d3bd0f9143587cfaeceb326e5daf78a979caca9567d2d46dea0
Contents?: true
Size: 797 Bytes
Versions: 30
Compression:
Stored size: 797 Bytes
Contents
class Kamal::Configuration::Validator::Registry < Kamal::Configuration::Validator STRING_OR_ONE_ITEM_ARRAY_KEYS = [ "username", "password" ] def validate! validate_against_example! \ config.except(*STRING_OR_ONE_ITEM_ARRAY_KEYS), example.except(*STRING_OR_ONE_ITEM_ARRAY_KEYS) validate_string_or_one_item_array! "username" validate_string_or_one_item_array! "password" end private def validate_string_or_one_item_array!(key) with_context(key) do value = config[key] error "is required" unless value.present? unless value.is_a?(String) || (value.is_a?(Array) && value.size == 1 && value.first.is_a?(String)) error "should be a string or an array with one string (for secret lookup)" end end end end
Version data entries
30 entries across 30 versions & 2 rubygems