summaryrefslogtreecommitdiff
path: root/tool/rbinstall.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-04-19 13:44:38 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-04-19 13:44:38 +0900
commit5d710d7e41ef3a9877426c87de121be3bf770e34 (patch)
tree361ac15860f1852a3fa4d2e55745e5efcee1eff1 /tool/rbinstall.rb
parentaae812d65d0759dd05816949427965978f3f484b (diff)
Fix the wrong file detection for net-*.gemspec
[Bug #17476][ruby-core:101724]
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-xtool/rbinstall.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 66686ebbc5..abeae88193 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -22,6 +22,7 @@ require 'fileutils'
require 'shellwords'
require 'optparse'
require 'optparse/shellwords'
+require 'pathname'
require 'rubygems'
begin
require "zlib"
@@ -703,6 +704,10 @@ module RbInstall
when "lib"
base = @base_dir
prefix = base.sub(/lib\/.*?\z/, "")
+ # for lib/net/net-smtp.gemspec
+ if m = Pathname.new(@gemspec).basename(".gemspec").to_s.match(/.*\-(.*)\z/)
+ base = "#{@base_dir}/#{m[1]}" unless remove_prefix(prefix, @base_dir).include?(m[1])
+ end
end
if base