diff options
| author | Max Howell | 2009-08-10 16:33:15 +0100 |
|---|---|---|
| committer | Max Howell | 2009-08-10 16:33:15 +0100 |
| commit | c0878c76d00e51140fcd36278708c8735df4346f (patch) | |
| tree | fa10261f76a43c09fdadae219c5468be29a59369 /Library | |
| parent | ef1e9b1a8c4e9bd824a0c06c73472e4c0f905f69 (diff) | |
| download | homebrew-c0878c76d00e51140fcd36278708c8735df4346f.tar.bz2 | |
FIX Pathname.rename
Rename relative to self.dirname
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/pathname+yeast.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/pathname+yeast.rb b/Library/Homebrew/pathname+yeast.rb index 75eb98bba..a60ce4bd3 100644 --- a/Library/Homebrew/pathname+yeast.rb +++ b/Library/Homebrew/pathname+yeast.rb @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with Homebrew. If not, see <http://www.gnu.org/licenses/>. - +# require 'pathname' # we enhance pathname to make our code more readable @@ -23,9 +23,10 @@ class Pathname FileUtils.mv to_s, dst end - def rename dst - dst=Pathname.new dst - dst.unlink if dst.exist? + def rename newname + raise unless file? + dst=dirname+newname + dst.unlink rescue nil mv dst end |
