diff options
author | David Rodriguez <deivid.rodriguez@riseup.net> | 2024-03-20 17:10:36 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-03-25 11:55:08 +0900 |
commit | 1e6117d66547b11b26f4e7dc50612ff26e03b634 (patch) | |
tree | 7e664930c7ad4c6a9c782c95d87966c40fe20aed /tool/rbinstall.rb | |
parent | 348d8bdb0edeb4df2ef40379ab579dfc15afc327 (diff) |
Simplify FileCollector interface
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-x | tool/rbinstall.rb | 12 |
1 files changed, 3 insertions, 9 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) + def ruby_libraries # install ext only when it's configured - !File.exist?("#{makefile_dir}/Makefile") - end + return [] unless File.exist?("#{makefile_dir}/Makefile") - def ruby_libraries 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 |