Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3973773

Browse files
Extract entry.full_name to a variable
1 parent 1f3bd66 commit 3973773

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/rubygems/package.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,16 @@ def extract_tar_gz(io, destination_dir, pattern = "*") # :nodoc:
411411
directories = []
412412
open_tar_gz io do |tar|
413413
tar.each do |entry|
414-
next unless File.fnmatch pattern, entry.full_name, File::FNM_DOTMATCH
414+
full_name = entry.full_name
415+
next unless File.fnmatch pattern, full_name, File::FNM_DOTMATCH
415416

416-
destination = install_location entry.full_name, destination_dir
417+
destination = install_location full_name, destination_dir
417418

418419
if entry.symlink?
419420
link_target = entry.header.linkname
420421
real_destination = link_target.start_with?("/") ? link_target : File.expand_path(link_target, File.dirname(destination))
421422

422-
raise Gem::Package::SymlinkError.new(entry.full_name, real_destination, destination_dir) unless
423+
raise Gem::Package::SymlinkError.new(full_name, real_destination, destination_dir) unless
423424
normalize_path(real_destination).start_with? normalize_path(destination_dir + "/")
424425
end
425426

0 commit comments

Comments
 (0)