class Inspec::RequireLoader

Constants

Item

Public Class Methods

new() click to toggle source
# File lib/inspec/require_loader.rb, line 5
def initialize
  @contents = {}
end

Public Instance Methods

add(path, content, ref, line) click to toggle source
# File lib/inspec/require_loader.rb, line 9
def add(path, content, ref, line)
  @contents[path] = Item.new(content, ref, line, false)
end
exists?(path) click to toggle source
# File lib/inspec/require_loader.rb, line 21
def exists?(path)
  @contents.key?(path)
end
load(path) { |res| ... } click to toggle source
# File lib/inspec/require_loader.rb, line 13
def load(path)
  c = @contents[path]
  c.loaded = true
  res = [c.content, c.ref, c.line || 1]
  yield res if block_given?
  res
end
loaded?(path) click to toggle source
# File lib/inspec/require_loader.rb, line 25
def loaded?(path)
  @contents[path].loaded == true
end