Merge pull request #4476 from inspec/zenspider/gem_pathing

Use File.realpath in Loader#plugin_gem_path to resolve all symlinks.
This commit is contained in:
Ryan Davis 2019-09-17 18:13:35 -07:00 committed by GitHub
commit 577521296c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,7 +123,9 @@ module Inspec::Plugin::V2
require "rbconfig"
ruby_abi_version = RbConfig::CONFIG["ruby_version"]
# TODO: why are we installing under the api directory for plugins?
File.join(Inspec.config_dir, "gems", ruby_abi_version)
base_dir = Inspec.config_dir
base_dir = File.realpath base_dir if File.exist? base_dir
File.join(base_dir, "gems", ruby_abi_version)
end
# Lists all gems found in the plugin_gem_path.