From: nobu.nokada@... Date: 2002-09-18T02:01:20+09:00 Subject: Re: How to tell what directory the current file is in? Hi, At Wed, 18 Sep 2002 01:28:55 +0900, Philip Mak wrote: > How can I tell what directory the current file being executed is in? File.expand_path(File.dirname(__FILE__)) > I want entity.rb to load all the .rb files inside the "entity" directory. > I'm trying this right now: > > File.find('entity') do |f| > load f if f =~ /\.rb$/ > end Dir.glob(File.dirname(__FILE__)+"/*.rb") do |f| load f end Or Dir.foreach(File.dirname(__FILE__)) do |f| load f if /\.rb$/ =~ f end -- Nobu Nakada