Ruby几个相关目录

current file's path
puts "File.dirname(__FILE__) == #{File.dirname(__FILE__)}"

current work directory
$CurrentDir = Dir.pwd

# Parent of current work directory
File.expand_path("..",Dir.pwd)
puts File.expand_path('../.')

原文地址:https://www.cnblogs.com/bluescorpio/p/2975963.html