mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
Fix plugin issues on omni builds (#3499)
* Fix plugin issues on omni builds * Fix gemspec to include etc dir. Signed-off-by: Jared Quick <jquick@chef.io>
This commit is contained in:
parent
6a671324a1
commit
f7551b3de3
4 changed files with 17 additions and 2 deletions
|
@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = %w{README.md MAINTAINERS.toml MAINTAINERS.md LICENSE
|
||||
inspec-core.gemspec Gemfile CHANGELOG.md} +
|
||||
Dir.glob('{bin,docs,examples,lib}/**/*', File::FNM_DOTMATCH)
|
||||
Dir.glob('{bin,lib,etc}/**/*', File::FNM_DOTMATCH)
|
||||
.reject { |f| File.directory?(f) || f =~ /aws|azure|gcp/ }
|
||||
|
||||
spec.executables = %w{inspec}
|
||||
|
|
|
@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|||
README.md Rakefile MAINTAINERS.md LICENSE inspec.gemspec
|
||||
Gemfile CHANGELOG.md .rubocop.yml
|
||||
} + Dir.glob(
|
||||
'{bin,lib}/**/*', File::FNM_DOTMATCH
|
||||
'{bin,lib,etc}/**/*', File::FNM_DOTMATCH
|
||||
).reject { |f| File.directory?(f) }
|
||||
|
||||
spec.executables = %w{inspec}
|
||||
|
|
|
@ -395,10 +395,21 @@ module Inspec::Plugin::V2
|
|||
class InstalledVendorSet < Gem::Resolver::VendorSet
|
||||
def initialize
|
||||
super
|
||||
|
||||
Gem::Specification.find_all do |spec|
|
||||
@specs[spec.name] = spec
|
||||
@directories[spec] = spec.gem_dir
|
||||
end
|
||||
|
||||
if !defined?(::Bundler)
|
||||
directories = Gem::Specification.dirs.find_all do |path|
|
||||
!path.start_with?(Gem.user_dir)
|
||||
end
|
||||
Gem::Specification.each_spec(directories) do |spec|
|
||||
@specs[spec.name] = spec
|
||||
@directories[spec] = spec.gem_dir
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -31,6 +31,10 @@ module Inspec::Plugin::V2
|
|||
end
|
||||
|
||||
def load_all
|
||||
# This fixes the gem paths on some bundles
|
||||
Gem.path << plugin_gem_path
|
||||
Gem.refresh
|
||||
|
||||
# Be careful not to actually iterate directly over the registry here;
|
||||
# we want to allow "sidecar loading", in which case a plugin may add an entry to the registry.
|
||||
registry.plugin_names.dup.each do |plugin_name|
|
||||
|
|
Loading…
Reference in a new issue