Issue #8525 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Rejected

Pathname.new("/tmp").basename returns "tmp", and expanded result from "/tmp" is "/tmp/tmp".
If you want pathname which may not exist, use Pathname#realdirpath instead.
----------------------------------------
Bug #8525: Error? in pathname :: Pathname.new(`pwd`.chomp).basename.realpath
https://bugs.ruby-lang.org/issues/8525#change-39916

Author: dimytch (Dimitri Peka)
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: current: 2.1.0
ruby -v: ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


[code]
Dir.chdir '/tmp'
p = Pathname.new(`pwd`.chomp).basename.realpath
Errno::ENOENT: No such file or directory - /tmp/tmp
	from (irb):17:in `realpath'
	from (irb):17:in `realpath'
	from (irb):17
	from /usr/bin/irb:12:in `<main>'
[/code]

As I got p must be '/tmp'. Am I wrong?


-- 
http://bugs.ruby-lang.org/