summaryrefslogtreecommitdiff
path: root/tool/rbinstall.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-02-14 11:05:23 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-02-14 11:05:23 +0900
commit31f4dec6373c15a58899f8b86e35d48a7d813bf6 (patch)
tree03970fc639a6d90123f37c4d7333368a54ee58b4 /tool/rbinstall.rb
parent813fe4c256f89babebb8ab53821ae5eb6bb138c6 (diff)
downloadruby-31f4dec6373c15a58899f8b86e35d48a7d813bf6.tar.gz
Refined installation of gemspecs placed other than ext and lib
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-xtool/rbinstall.rb13
1 files changed, 7 insertions, 6 deletions
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