From f650c672c49438e06f2beac32dcfbbb7ea07bfe7 Mon Sep 17 00:00:00 2001 From: Florin Dragos Date: Fri, 10 Jul 2020 16:15:13 +0300 Subject: [PATCH] (maint) Don't use git to detect files to package --- agent/facter-ng.gemspec | 19 +++++-------------- facter.gemspec | 20 ++++---------------- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/agent/facter-ng.gemspec b/agent/facter-ng.gemspec index 0aa113cd46..a56a304c6e 100644 --- a/agent/facter-ng.gemspec +++ b/agent/facter-ng.gemspec @@ -14,22 +14,13 @@ Gem::Specification.new do |spec| spec.summary = 'New version of Facter' spec.description = 'New version of Facter' - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = if system('git --help &> /dev/null') - `git ls-files -z`.split("\x0") - else - Dir.glob('**/*') - end + spec.files = Dir['bin/facter-ng'] + + Dir['lib/**/*.rb'] + + Dir['lib/**/*.json'] + + Dir['lib/**/*.conf'] + + Dir['agent/**/*'] spec.required_ruby_version = '~> 2.3' - spec.files.reject! do |f| - f.match(%r{^(test|spec|features|acceptance)/}) - end - - spec.files.reject! do |f| - f == 'bin/facter' - end spec.bindir = 'bin' spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } diff --git a/facter.gemspec b/facter.gemspec index e914a4f324..619431df43 100644 --- a/facter.gemspec +++ b/facter.gemspec @@ -14,24 +14,12 @@ Gem::Specification.new do |spec| spec.summary = 'New version of Facter' spec.description = 'New version of Facter' - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - # On our internal Jenkins, there is no git. As it is a clean machine, we don't need to worry about anything else. - spec.files = if system('git --help &> /dev/null') - `git ls-files -z`.split("\x0") - else - Dir.glob('**/*') - end + spec.files = Dir['bin/facter'] + + Dir['lib/**/*.rb'] + + Dir['lib/**/*.json'] + + Dir['lib/**/*.conf'] spec.required_ruby_version = '~> 2.3' - spec.files.reject! do |f| - f.match(%r{^(test|spec|features|acceptance)/}) - end - - spec.files.reject! do |f| - f == 'bin/facter-ng' - end - spec.bindir = 'bin' spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.require_paths = ['lib']