Ruby でパスを絶対パスに展開する

~/ を設定パスに展開したかったんですが、File.expand_path() を使えばよいみたい

File.expand_path("~/")
# => /home/username


参照