summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-16 02:35:23 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-16 02:35:23 +0000
commit86b33867b156f9d80bdccf895f16ec0ac3a8a204 (patch)
tree48759c24523d5d28db46a58e375678db89e6a6aa /lib
parent32deb3ff495921769ee0cc6f245e121e59336b1a (diff)
downloadpuppet-86b33867b156f9d80bdccf895f16ec0ac3a8a204.tar.gz
puppet-86b33867b156f9d80bdccf895f16ec0ac3a8a204.tar.xz
puppet-86b33867b156f9d80bdccf895f16ec0ac3a8a204.zip
Adding the ability to have hooks for configuration parameters. This will simplify things like setting the shell path.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1783 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/config.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/puppet/config.rb b/lib/puppet/config.rb
index 8d7b6b895..5725bcd93 100644
--- a/lib/puppet/config.rb
+++ b/lib/puppet/config.rb
@@ -721,6 +721,10 @@ Generated on #{Time.now}.
@desc = value.gsub(/^\s*/, '')
end
+ def hook=(block)
+ meta_def :handle, &block
+ end
+
# Create the new element. Pretty much just sets the name.
def initialize(args = {})
if args.include?(:parent)
@@ -805,11 +809,16 @@ Generated on #{Time.now}.
if respond_to?(:validate)
validate(value)
end
+
if respond_to?(:munge)
@value = munge(value)
else
@value = value
end
+
+ if respond_to?(:handle)
+ handle(@value)
+ end
end
end