mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
Clean up the end of our custom require.
There are only 2 options. Shortcutting one of them with a `require` just makes it messy. Use `if`. It's really basic. Basic is good. Maybe we should try to push towards basic and good. It would be work but make us happier in the long run. Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
parent
99f86c8a0b
commit
fdc281d19c
1 changed files with 5 additions and 3 deletions
|
@ -23,10 +23,12 @@ module Inspec
|
|||
# context that provides the correct plane to evaluate all required files to.
|
||||
# It will ensure that embedded calls to `require` still call this
|
||||
# method and get loaded from their correct paths.
|
||||
return __inspec_binding.eval(content, path, line) if defined?(__inspec_binding)
|
||||
|
||||
if defined?(__inspec_binding)
|
||||
__inspec_binding.eval(content, path, line)
|
||||
else
|
||||
eval(content, TOPLEVEL_BINDING, path, line) # rubocop:disable Security/Eval
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue