Open rbclark opened 2 years ago
Another way to do this would be
- spec.files = `git ls-files -z`.split("\x0")
- spec.files.reject! { |fn| fn.include?('test/files') }
+ spec.files = Dir['CHANGELOG.md', '{examples,lib}/**/*', 'LICENSE', README.md']
Summary
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.Other Information
Without this change the following error happens if a user attempts to use an inspec plugin that requires 'roo':
This should also have the added bonus of slimming what is actually published with the gem, since it seems likely that the test and spec files are not required for end users of roo.