118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
# File 'lib/inspec/profile_context.rb', line 118
def load_libraries(libs)
lib_prefix = 'libraries' + File::SEPARATOR
autoloads = []
libs.sort_by! { |l| l[1] } libs.each do |content, source, line|
path = source
if source.start_with?(lib_prefix)
path = source.sub(lib_prefix, '')
autoloads.push(path) if File.dirname(path) == '.'
end
@require_loader.add(path, content, source, line)
end
autoloads.each do |path|
next unless path.end_with?('.rb')
load_library_file(*@require_loader.load(path)) unless @require_loader.loaded?(path)
end
reload_dsl
end
|