summaryrefslogtreecommitdiffstats
path: root/lib/puppet/configuration.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-07 18:20:08 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-07 18:20:08 +0000
commit162602323406117444ce4375ead91d8f92f2b31a (patch)
tree7aa885b5fb2767ad731a32d023e804de5d6876b5 /lib/puppet/configuration.rb
parent99c8a548c7980408cde0ffc51a3b7685a4965978 (diff)
downloadpuppet-162602323406117444ce4375ead91d8f92f2b31a.tar.gz
puppet-162602323406117444ce4375ead91d8f92f2b31a.tar.xz
puppet-162602323406117444ce4375ead91d8f92f2b31a.zip
Adding a libdir setting for puppet, so you can store your modifications to puppet in a separate directory. This probably will still be somewhat limited because it will always depend somewhat on load order. For instance, if you add a new provider, it might not be available when you expect, since providers are all loaded as soon as a type is loaded, which might happen before the libdir is set. It should always work fine if you do not override it, but if you do override it, things might behave a bit strange.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2174 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/configuration.rb')
-rw-r--r--lib/puppet/configuration.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/puppet/configuration.rb b/lib/puppet/configuration.rb
index 80b855a7d..952a54397 100644
--- a/lib/puppet/configuration.rb
+++ b/lib/puppet/configuration.rb
@@ -94,6 +94,20 @@ module Puppet
:hook => proc do |value|
ENV["PATH"] = value unless value == "none"
end
+ },
+ :libdir => {:default => "$vardir/lib",
+ :desc => "An extra search path for Puppet. This is only useful
+ for those files that Puppet will load on demand, and is only
+ guaranteed to work for those cases. In fact, the autoload
+ mechanism is responsible for making sure this directory
+ is in Ruby's search path",
+ :hook => proc do |value|
+ if defined? @oldlibdir and $:.include?(@oldlibdir)
+ $:.delete(@oldlibdir)
+ end
+ @oldlibdir = value
+ $: << value
+ end
}
)