LoginSignup
0
0

More than 5 years have passed since last update.

irb内から外部ファイルを参照する

Posted at

irbでファイルを読む
例えばメールファイルを読む場合は下記のようにする

irb(main):001:0> require'mail'
irb(main):002:0> Mail.read("./email.log")
irb(main):003:0> mail.subject
=> "hogehoge"

irbを開いた場所からの相対パス指定でファイルを開ける。

参考
http://stackoverflow.com/questions/6149850/ruby-on-rails-running-a-rb-file-from-irb

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0