1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Refined installation of gemspecs placed other than ext and lib

This commit is contained in:
Nobuyoshi Nakada 2021-02-14 11:05:23 +09:00
parent 813fe4c256
commit 31f4dec637
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -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