lib/pa/path.rb in pa-1.3.1 vs lib/pa/path.rb in pa-1.3.2
- old
+ new
@@ -55,14 +55,22 @@
# Alias from File.expand_path
#
# @param [String,Pa] path
# @return [String]
- def expand2(path)
- File.expand_path get(path)
+ def expand2(name, dir=".")
+ File.expand_path(get(name), dir)
end
+ # Alias from Filel.realpath
+ #
+ # @param [String, Pa] path
+ # @return [String]
+ def real2(name, dir=".")
+ File.realpath(get(name), dir)
+ end
+
# Path relative_to? dir
#
# @example
#
# Pa.relative_to?("/home/foo", "/home") -> true
@@ -168,14 +176,9 @@
p
else
ret == "." ? "" : ret
File.join("~", ret)
end
- end
-
- # real path
- def real2(path)
- File.realpath get(path)
end
# get parent path
#
# @param [String,Pa] path