diff options
| author | Jack Nagel | 2015-03-26 22:22:45 -0400 |
|---|---|---|
| committer | Jack Nagel | 2015-03-26 22:22:45 -0400 |
| commit | 96f7a8015f0b8ffd0fdd6b72dfea0ffe5c2ad389 (patch) | |
| tree | ee294e9dc97d7624b0a8e7f76b452580d3639106 /Library/Homebrew/extend | |
| parent | 3721e0be6fc058e66603d46ba4565c5d84f0666b (diff) | |
| download | brew-96f7a8015f0b8ffd0fdd6b72dfea0ffe5c2ad389.tar.bz2 | |
Pass around only pathname objects
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 7ab3cad54..f812e2076 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -37,9 +37,8 @@ class Pathname def install_p(src, new_basename) raise Errno::ENOENT, src.to_s unless File.symlink?(src) || File.exist?(src) - src = src.to_s - dst = join(new_basename).to_s - + src = Pathname(src) + dst = join(new_basename) dst = yield(src, dst) if block_given? mkpath @@ -48,7 +47,7 @@ class Pathname # is a symlink, and its target is moved first, FileUtils.mv will fail: # https://bugs.ruby-lang.org/issues/7707 # In that case, use the system "mv" command. - if File.symlink? src + if src.symlink? raise unless Kernel.system 'mv', src, dst else FileUtils.mv src, dst |
