mirror of
https://github.com/inspec/inspec
synced 2024-11-23 05:03:07 +00:00
Distinguish between core gems and system gems and load system gems normally.
Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
parent
093af59ea2
commit
3eac105498
1 changed files with 4 additions and 1 deletions
|
@ -48,9 +48,12 @@ module Inspec::Plugin::V2
|
||||||
begin
|
begin
|
||||||
# We could use require, but under testing, we need to repeatedly reload the same
|
# We could use require, but under testing, we need to repeatedly reload the same
|
||||||
# plugin. However, gems only work with require (rubygems dooes not overload `load`)
|
# plugin. However, gems only work with require (rubygems dooes not overload `load`)
|
||||||
if plugin_details.installation_type == :user_gem
|
case plugin_details.installation_type
|
||||||
|
when :user_gem
|
||||||
activate_managed_gems_for_plugin(plugin_name)
|
activate_managed_gems_for_plugin(plugin_name)
|
||||||
require plugin_details.entry_point
|
require plugin_details.entry_point
|
||||||
|
when :system_gem
|
||||||
|
require plugin_details.entry_point
|
||||||
else
|
else
|
||||||
load_path = plugin_details.entry_point
|
load_path = plugin_details.entry_point
|
||||||
load_path += ".rb" unless plugin_details.entry_point.end_with?(".rb")
|
load_path += ".rb" unless plugin_details.entry_point.end_with?(".rb")
|
||||||
|
|
Loading…
Reference in a new issue