diff --git a/filesystem/realpath.markdown b/filesystem/realpath.markdown index 67f657d..e012603 100644 --- a/filesystem/realpath.markdown +++ b/filesystem/realpath.markdown @@ -8,7 +8,8 @@ }} {{code:ruby - abs_path = File.expand_path('../to/foobar') + require 'pathname' + abs_path = Pathname.new('../to/foobar').realpath.to_s p abs_path #=> "/absolute/path/to/foobar"