From 31f4dec6373c15a58899f8b86e35d48a7d813bf6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 14 Feb 2021 11:05:23 +0900 Subject: Refined installation of gemspecs placed other than ext and lib --- tool/rbinstall.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tool/rbinstall.rb') diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index fece0c64f2..9f6c1c76a8 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -701,14 +701,15 @@ module RbInstall when "lib" base = @base_dir prefix = base.sub(/lib\/.*?\z/, "") + "lib/" + else + # other/something.gemspec -> + # [other/something.rb, other/something/foo.rb, ...] + base = @gemspec.chomp('.gemspec') + prefix = @base_dir end - if base - Dir.glob("#{base}{.rb,/**/*.rb}").collect do |ruby_source| - remove_prefix(prefix, ruby_source) - end - else - [File.basename(@gemspec, '.gemspec') + '.rb'] + Dir.glob("#{base}{.rb,/**/*.rb}").collect do |ruby_source| + remove_prefix(prefix, ruby_source) end end -- cgit v1.2.1