diff options
author | Luke Kanies <luke@madstop.com> | 2009-05-16 00:08:35 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-05-20 18:29:04 +1000 |
commit | 138f19fc6e7bb1d8ebf305decaa045c53787297c (patch) | |
tree | 00cb8da45f0ff7b12fede738b7df9e045a1583a9 /lib/puppet/util/autoload.rb | |
parent | 415553e9485d7ba3ed867033ac9c3315107d3c92 (diff) | |
download | puppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.tar.gz puppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.tar.xz puppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.zip |
Caching whether named autoloaded files are missing
This is the big win, because it causes us to just
skip the whole loading infrastructure, including
skipping looking through the modulepath.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/util/autoload.rb')
-rw-r--r-- | lib/puppet/util/autoload.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb index db06ea934..fb15adf92 100644 --- a/lib/puppet/util/autoload.rb +++ b/lib/puppet/util/autoload.rb @@ -73,6 +73,8 @@ class Puppet::Util::Autoload # Load a single plugin by name. We use 'load' here so we can reload a # given plugin. def load(name) + return false if named_file_missing?(name) + path = name.to_s + ".rb" searchpath.each do |dir| @@ -92,10 +94,10 @@ class Puppet::Util::Autoload puts detail.backtrace end end - return false + return named_file_is_missing(name) end end - return false + return named_file_is_missing(name) end # Mark the named object as loaded. Note that this supports unqualified |