Bug #3882
Updated by jeremyevans0 (Jeremy Evans) over 5 years ago
=begin Hi, #!/usr/bin/ruby require 'pathname' mytest_filename = ARGV.shift #mytest_filename_cleaned = Pathname.new(mytest_filename).cleanpath mytest_filename_cleaned = mytest_filename puts "mytest_filename #{mytest_filename} mytest_filename_cleaned #{mytest_filename_cleaned}" myext = File.extname(mytest_filename_cleaned) puts "mytest_filename_cleaned #{mytest_filename_cleaned} myext #{myext}" Try .//test.out Won't do what it should, at least on u10.04 ruby1.8 1.8.7.249-2 and ruby1.9.1 1.9.1.378-1, as opposed to correct behaviour on ruby-1.8.5-5.el5_4.8. Since http://ruby-doc.org/core/classes/File.html#M002543 doesn't really specify extname() argument composition constraints (other than it being a path), it _should_ accept duplicate slashes since this syntax is treated as a valid path pretty much everywhere. Do you happen to have a test suite for these core API things? Since extname() also had some other issues (spaces before extension etc.), this would be useful. Other than this rather disturbing behaviour, I'm VERY impressed with Ruby. Thanks, Andreas Mohr =end