summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/autoload.rb
Commit message (Collapse)AuthorAgeFilesLines
* Ruby no longer clobbers puppet autoloadingLuke Kanies2009-07-161-0/+1
| | | | | | | | | We basically just make sure that we tell Ruby about files we've loaded, so you can 'require' these files and doing so will essentially no-op, rather than clobbering the already-loaded code. Signed-off-by: Luke Kanies <luke@madstop.com>
* Caching whether named autoloaded files are missingLuke Kanies2009-05-201-2/+4
| | | | | | | | 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>
* Adding caching of file metadata to the autoloaderLuke Kanies2009-05-201-1/+4
| | | | | | | | | | | The cache isn't actually used yet - this just adds all of the plumbing. It was found that stat'ing files that didn't exist could take up to 85% of a run, so this is progress toward getting rid of those stats. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding modulepath caching to the AutoloaderLuke Kanies2009-05-201-17/+22
| | | | | | | | | There's more caching to add, but this simplifies the interface to the list of paths and then caches that list so we aren't constantly searching the filesystem. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1869 - autoloaded files should never leak exceptionsLuke Kanies2009-02-121-2/+2
| | | | | | | | | | | | | Ruby's exception hierarchy is a bit strange, in that only exceptions that sub RuntimeError are caught by default. This patch explicitly catches the base class, Exception, which means that LoadError, SyntaxError, and any RuntimeErrors will all be caught. This is done for both load() and loadall(); load() uses Kernel.load, but loadall() uses Kernel.require. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1064 -- providers et al are now autoloadedLuke Kanies2008-02-131-2/+1
| | | | from modules even when Autoload#loadall is used.
* removing "lib" deprecation notice from autoloaderLuke Kanies2008-02-131-4/+0
|
* Fixed #1043 -- autoloading now searches the plugins directoryLuke Kanies2008-02-131-3/+8
| | | | | | in each module, in addition to the lib directory. The 'lib' directory is also deprecated, but supported for now to give people a chance to convert.
* I finally tracked down the problem that was causing providersLuke Kanies2007-10-031-7/+2
| | | | | | | | | | | | to sometimes suddenly disappear and thus tests to fail -- Kernel.require was not loading the normal ruby path (e.g., 'puppet/type/cron'), so if someone else loaded that then it would replace the in-memory type with a new one, but that new one couldn't load its own providers, because the Kernel would ignore the providers, thinking they were already loaded. This doesn't fix all of the autoloading problems, but at least we won't suddenly break a ton of tests.
* *Finally* fixing the tests that were failing around users and groups. The ↵Luke Kanies2007-09-071-13/+12
| | | | problem was that the autoload tests were somehow clearing all loaded classes, including the providers. This is fixed now.
* I have added basic support for a search path, altho not yet with any ability ↵Luke Kanies2007-08-241-2/+0
| | | | to manipulate it. All config tests pass in both the old tests and the new ones, so it is time to add the hooks for manipulating the search path.
* Added optional per-module lib directory.Jeffrey J McCune2007-08-141-1/+7
| | | | | | | | Puppet now looks for a lib directory inside each module bundle, and adds the directory to the list searched by Puppet::Util::Autoload. The intent is to facilitate more sophisticated virtual types and flexibility within modules.
* Changing some of the internals of autoloading so that there is a class-level ↵luke2007-07-101-15/+44
| | | | | | method to query whether a given file has been loaded. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2668 980ebf18-57e1-0310-9a29-db15c13687c0
* Redoing autoload a bit in preparation for adding a plugindirluke2007-05-161-46/+58
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2518 980ebf18-57e1-0310-9a29-db15c13687c0
* Moving some of the stand-alone classes into the util/ subdirectory, to clean ↵luke2007-02-071-0/+107
up the top-level namespace a bit. This is a lot of file modifications, but most of them just change class names and file paths. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2178 980ebf18-57e1-0310-9a29-db15c13687c0