icn icn - 1 year ago 161
Ruby Question

Get parent directory of current directory in Ruby

I understand I can get current directory by

$CurrentDir = Dir.pwd


How about parent directory of current directory?

Answer Source
File.expand_path("..", Dir.pwd)