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

rbinstall.rb: do not install useless files after installed

This commit is contained in:
Nobuyoshi Nakada 2020-12-07 23:57:31 +09:00
parent 91f831ac17
commit 05e1d87e62
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -879,7 +879,6 @@ def load_gemspec(file, expanded = false)
if expanded
base = File.dirname(file)
Dir.glob("**/*", File::FNM_DOTMATCH, base: base) do |n|
next if n.start_with?(".git") # git related files are useless
case File.basename(n); when ".", ".."; next; end
next if File.directory?(File.join(base, n))
files << n.dump
@ -892,6 +891,7 @@ def load_gemspec(file, expanded = false)
raise TypeError, "[#{file}] isn't a Gem::Specification (#{spec.class} instead)."
end
spec.loaded_from = file
spec.files.reject! {|n| n.end_with?(".gemspec") or n.start_with?(".git")}
spec
end