Sha256: 0b5554f14a0ce65650f0f82cf180cdf67ffe643f6dba2804e140e68a3a0fae7b
Contents?: true
Size: 868 Bytes
Versions: 8
Compression:
Stored size: 868 Bytes
Contents
# frozen_string_literal: true # A simple boolean. class Puppet::Settings::BooleanSetting < Puppet::Settings::BaseSetting # get the arguments in getopt format def getopt_args if short [["--#{name}", "-#{short}", GetoptLong::NO_ARGUMENT], ["--no-#{name}", GetoptLong::NO_ARGUMENT]] else [["--#{name}", GetoptLong::NO_ARGUMENT], ["--no-#{name}", GetoptLong::NO_ARGUMENT]] end end def optparse_args if short ["--[no-]#{name}", "-#{short}", desc, :NONE] else ["--[no-]#{name}", desc, :NONE] end end def munge(value) case value when true, "true"; return true when false, "false"; return false else raise Puppet::Settings::ValidationError, _("Invalid value '%{value}' for boolean parameter: %{name}") % { value: value.inspect, name: @name } end end def type :boolean end end
Version data entries
8 entries across 8 versions & 1 rubygems