@mypath = File.expand_path(File.dirname(__FILE__)) def foo puts @mypath end foo