From 279e147150c5997a50501df739264d5759860e10 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 10 Dec 2018 10:13:38 -0800 Subject: [PATCH] Only ship the runtime files in the gem to slim install sizes Don't ship the readme, changelog, or test files in the gem artifact. There's no need for these files deep in a Ruby install. This shrinks the gem install from 108k to 49k. Signed-off-by: Tim Smith --- train-core.gemspec | 2 +- train.gemspec | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/train-core.gemspec b/train-core.gemspec index e856e50f..646c13ea 100644 --- a/train-core.gemspec +++ b/train-core.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/inspec/train/' spec.license = 'Apache-2.0' - spec.files = %w{train-core.gemspec README.md LICENSE Gemfile CHANGELOG.md} + Dir + spec.files = %w{LICENSE} + Dir .glob('lib/**/*', File::FNM_DOTMATCH) .reject { |f| f =~ %r{lib/train/transports} unless CORE_TRANSPORTS.include?(f) } .reject { |f| File.directory?(f) } diff --git a/train.gemspec b/train.gemspec index 104c15d7..607846a8 100644 --- a/train.gemspec +++ b/train.gemspec @@ -13,11 +13,7 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/inspec/train/' spec.license = 'Apache-2.0' - spec.files = %w{ - train.gemspec README.md Rakefile LICENSE Gemfile CHANGELOG.md .rubocop.yml - } + Dir.glob( - '{lib,test}/**/*', File::FNM_DOTMATCH - ).reject { |f| File.directory?(f) } + spec.files = %w{LICENSE} + Dir.glob('lib/**/*', File::FNM_DOTMATCH).reject { |f| File.directory?(f) } spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/})