lib/puppet/settings/base_setting.rb
# Convert the object to a config statement.
Convert the object to a config statement.
Convert the object to a config statement .
def to_config
    str = @desc.gsub(/^/, "# ") + "\n"
    str += "# The default value is '#{default(true)}'.\n" if default(true)
    value = @settings.value(self.name)
    if value != @default
      line = "#{@name} = #{value}"
    else
      line = "# #{@name} = #{@default}"
    end
    str += line + "\n"
    str.gsub(/^/, "    ")
  end
def to_config str = @desc . gsub ( / ^ / , "# " ) + "\n" str += "# The default value is '#{default(true)}'.\n" if default ( true ) value = @settings . value ( self . name ) if value != @default line = "#{@name} = #{value}" else line = "# #{@name} = #{@default}" end str += line + "\n" str . gsub ( / ^ / , "    " ) end
Convert the object to a config statement.
Convert the object to a config statement .
# Add in a statement about the default. # If the value has not been overridden, then print it out commented # and unconverted, so it's clear that that's the default and how it # works.