Cross-platform check for absolute filepath.

This commit is contained in:
Jeff Hodges 2009-05-30 21:12:40 -07:00
parent 97e2133282
commit 820c9df1b0

View File

@ -1,4 +1,5 @@
require 'fileutils'
require 'pathname'
RealFile = File
RealFileUtils = FileUtils
@ -240,7 +241,7 @@ module FakeFS
end
def normalize_path(path)
if path[0,1] == '/'
if Pathname.new(path).absolute?
File.expand_path(path)
else
parts = dir_levels + [path]