mirror of
https://github.com/inspec/inspec
synced 2024-11-23 05:03:07 +00:00
Added extra doco on our require method.
Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
parent
d7bae9de30
commit
07631a53e7
1 changed files with 20 additions and 0 deletions
|
@ -8,6 +8,26 @@ module Inspec
|
|||
# It is used whenever the `require 'lib'` is not in libraries.
|
||||
alias __ruby_require require
|
||||
|
||||
##
|
||||
# This is our own require override, to be used in
|
||||
# LibraryEvalContext and ControlEvalContext.
|
||||
#
|
||||
# Any top level libraries file (autoloaded) that requires a
|
||||
# second-level libraries file.
|
||||
#
|
||||
# in load_libraries
|
||||
# in top level libraries file to be autoloaded
|
||||
# that has a require to a known file that is NOT loaded yet
|
||||
#
|
||||
# ProfileContext#initialize
|
||||
# -> library_eval_context
|
||||
#
|
||||
# ProfileContext#load_libraries autoload
|
||||
# -> load_library_file(@library_eval_context)
|
||||
#
|
||||
# probably most of this comment is useless, but it was hard to
|
||||
# discover so I'm adding it for others.
|
||||
|
||||
def require(path)
|
||||
rbpath = path + ".rb"
|
||||
return __ruby_require(path) unless @require_loader.exists?(rbpath)
|
||||
|
|
Loading…
Reference in a new issue