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

Revert following rbinstall.rb changes

Because unexpected names are listed in gemspec files.

* "Fix gemspec only case"
  fc56b96b09

* "Refined installation of gemspecs placed other than ext and lib"
  31f4dec637
This commit is contained in:
Nobuyoshi Nakada 2021-02-14 16:49:14 +09:00
parent ff527e7e32
commit 504d6dc429
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -701,20 +701,14 @@ module RbInstall
when "lib"
base = @base_dir
prefix = base.sub(/lib\/.*?\z/, "")
else
# other/something.gemspec ->
# [other/something.rb, other/something/foo.rb, ...]
base = @gemspec.chomp('.gemspec')
prefix = @base_dir
end
libs = Dir.glob("#{base}{.rb,/**/*.rb}").collect do |ruby_source|
remove_prefix(prefix, ruby_source)
end
if libs.empty?
[File.basename(@gemspec, '.gemspec') + '.rb']
if base
Dir.glob("#{base}{.rb,/**/*.rb}").collect do |ruby_source|
remove_prefix(prefix, ruby_source)
end
else
libs
[File.basename(@gemspec, '.gemspec') + '.rb']
end
end