From 1e6117d66547b11b26f4e7dc50612ff26e03b634 Mon Sep 17 00:00:00 2001 From: David Rodriguez Date: Wed, 20 Mar 2024 17:10:36 +0100 Subject: [PATCH] Simplify FileCollector interface --- tool/rbinstall.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 3a36777420..62a44af6f9 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -553,12 +553,10 @@ module RbInstall end class Ext < self - def skip_install?(files) - # install ext only when it's configured - !File.exist?("#{makefile_dir}/Makefile") - end - def ruby_libraries + # install ext only when it's configured + return [] unless File.exist?("#{makefile_dir}/Makefile") + Dir.glob("lib/**/*.rb", base: makefile_dir) end @@ -570,10 +568,6 @@ module RbInstall end class Lib < self - def skip_install?(files) - files.empty? - end - def ruby_libraries gemname = File.basename(gemspec, ".gemspec") base = relative_base || gemname @@ -763,7 +757,7 @@ def install_default_gem(dir, srcdir, bindir) spec = load_gemspec("#{base}/#{src}") file_collector = RbInstall::Specs::FileCollector.for(srcdir, dir, src) files = file_collector.collect - if file_collector.skip_install?(files) + if files.empty? next end spec.files = files