Dir.rb
This content was produced by an LLM and could include errors.
このスクリプトは特殊メソッド __dir__ の確認用です。実行中のソースファイルが置かれたディレクトリの絶対パスを返します(IRB上ではカレントディレクトリ)。相対パスの基準をファイル位置に揃えたいときに役立ちます。
__dir__
#=> "."
Ruby 4.0.6
This content was produced by an LLM and could include errors.
このスクリプトは特殊メソッド __dir__ の確認用です。実行中のソースファイルが置かれたディレクトリの絶対パスを返します(IRB上ではカレントディレクトリ)。相対パスの基準をファイル位置に揃えたいときに役立ちます。
__dir__
#=> "."
Ruby 4.0.6