Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb index 69a80fa..63f62f2 100644 --- a/lib/puppet/util/autoload.rb +++ b/lib/puppet/util/autoload.rb @@ -133,14 +133,20 @@ class Puppet::Util::Autoload end end - # The list of directories to search through for loadable plugins. - def searchpath + def self.searchpath + return @searchpath if @searchpath # JJM: Search for optional lib directories in each module bundle. module_lib_dirs = Puppet[:modulepath].split(":").collect do |d| Dir.glob("%s/*/{plugins,lib}" % d).select do |f| FileTest.directory?(f) end end.flatten - [module_lib_dirs, Puppet[:libdir], $:].flatten + @searchpath = [module_lib_dirs, Puppet[:libdir], $:].flatten + @searchpath + end + + # The list of directories to search through for loadable plugins. + def searchpath + self.class.searchpath end end
This paste will be private.
From the Design Piracy series on my blog: