summaryrefslogtreecommitdiff
path: root/lib/puppet/type
diff options
context:
space:
mode:
authorChris Price <chris@puppetlabs.com>2012-09-20 12:53:59 -0700
committerChris Price <chris@puppetlabs.com>2012-09-20 12:53:59 -0700
commit4ff4995d9efa15504eaf33e27385b5e2c4092087 (patch)
tree363d5bd285f3f03e113b08b1deae5eac45eb98da /lib/puppet/type
parent310a4b1575f7af903ac97108c6f1352d05f5f3fc (diff)
parente527908b7c6ac5d91677229a96d5a97194dc68b7 (diff)
downloadpuppet-inifile-4ff4995d9efa15504eaf33e27385b5e2c4092087.tar.gz
puppet-inifile-4ff4995d9efa15504eaf33e27385b5e2c4092087.tar.bz2
Merge pull request #9 from cprice-puppet/feature/master/allow-override-of-separator-str
Allow overriding separator string between key/val pairs
Diffstat (limited to 'lib/puppet/type')
-rw-r--r--lib/puppet/type/ini_setting.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/puppet/type/ini_setting.rb b/lib/puppet/type/ini_setting.rb
index 9af47c1..50b6b38 100644
--- a/lib/puppet/type/ini_setting.rb
+++ b/lib/puppet/type/ini_setting.rb
@@ -30,4 +30,17 @@ Puppet::Type.newtype(:ini_setting) do
end
end
-end \ No newline at end of file
+ newparam(:key_val_separator) do
+ desc 'The separator string to use between each setting name and value. ' +
+ 'Defaults to " = ", but you could use this to override e.g. whether ' +
+ 'or not the separator should include whitespace.'
+ defaultto(" = ")
+
+ validate do |value|
+ unless value.scan('=').size == 1
+ raise Puppet::Error, ":key_val_separator must contain exactly one = character."
+ end
+ end
+ end
+
+end