Method: Inspec::ProfileContext#load_with_context
- Defined in:
- lib/inspec/profile_context.rb
#load_with_context(context, content, source = nil, line = nil) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/inspec/profile_context.rb', line 138 def load_with_context(context, content, source = nil, line = nil) Inspec::Log.debug("Loading #{source || '<anonymous content>'} into #{self}") @current_load = { file: source } if content.is_a? Proc context.instance_eval(&content) elsif source.nil? && line.nil? context.instance_eval(content) else context.instance_eval(content, source || 'unknown', line || 1) end end |