Skip to content

Commit

Permalink
Simplify File.expand_path usage
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Oct 8, 2021
1 parent 1970b12 commit 02e3cf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubygems/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def install_location(filename, destination_dir) # :nodoc:
filename.start_with? '/'

destination_dir = File.expand_path(File.realpath(destination_dir))
destination = File.expand_path(File.join(destination_dir, filename))
destination = File.expand_path(filename, destination_dir)

raise Gem::Package::PathError.new(destination, destination_dir) unless
destination.start_with? destination_dir + '/'
Expand Down

0 comments on commit 02e3cf4

Please sign in to comment.