From: Nigel Hennan Date: 2009-05-07T09:16:20+09:00 Subject: How to get class' filepath from methods in included mixin? Hi, File.dirname(__FILE__) returns the current folder where the script in, How to get it from methods in included modules? My sample code as below: helper.rb --------- module Helper def your_path puts instance_eval { File.expand_path(File.dirname(__FILE__)) } # doesn't work end end a.rb ----- require 'helper/helper' class A include Helper end A.new.your_path #=> return helper's file path, not class A's -- Posted via http://www.ruby-forum.com/.