Cross-platform check for absolute filepath.
This commit is contained in:
parent
97e2133282
commit
820c9df1b0
@ -1,4 +1,5 @@
|
|||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
|
require 'pathname'
|
||||||
|
|
||||||
RealFile = File
|
RealFile = File
|
||||||
RealFileUtils = FileUtils
|
RealFileUtils = FileUtils
|
||||||
@ -240,7 +241,7 @@ module FakeFS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def normalize_path(path)
|
def normalize_path(path)
|
||||||
if path[0,1] == '/'
|
if Pathname.new(path).absolute?
|
||||||
File.expand_path(path)
|
File.expand_path(path)
|
||||||
else
|
else
|
||||||
parts = dir_levels + [path]
|
parts = dir_levels + [path]
|
||||||
|
Loading…
Reference in New Issue
Block a user