From 6b8326bf0c5f744ca3a94d257bfda970312c3a11 Mon Sep 17 00:00:00 2001 From: Robert Clark Date: Thu, 7 Oct 2021 12:16:46 -0400 Subject: [PATCH] Use Dir.glob instead of git ls-files in gemspec Using git ls-files causes strange errors with the inspec plugin system. This is due to the inspec plugin system reading the gemspec and attempting to execute the `files` command which throws an error with the installed version of the gem. This updated gemspec will execute successfully even if git isn't installed or a .git directory is not present. --- roo.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roo.gemspec b/roo.gemspec index cc30a7a7..724cebe0 100644 --- a/roo.gemspec +++ b/roo.gemspec @@ -13,8 +13,8 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/roo-rb/roo' spec.license = 'MIT' - spec.files = `git ls-files -z`.split("\x0") - spec.files.reject! { |fn| fn.include?('test/files') } + spec.files = Dir.glob('lib/**/*').reject { |f| File.directory?(f) } + %w{CHANGELOG.md LICENSE README.md Gemfile roo.gemspec} + spec.require_paths = ['lib'] spec.required_ruby_version = ">= 2.5.0"