[Ironruby-core] How to refer to the .rb files in a folder?

Jim Deville jdeville at microsoft.com
Mon Jun 22 11:34:11 EDT 2009

Dir.chdir(".") do
  Dir["*.rb"].each do |f|
    require f

I don't know of a way in Ruby to do what you are asking for without looping through the files.


...there is no try

> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-
> bounces at rubyforge.org] On Behalf Of Mohammad Azam
> Sent: Monday, June 22, 2009 8:26 AM
> To: ironruby-core at rubyforge.org
> Subject: [Ironruby-core] How to refer to the .rb files in a folder?
> I am trying to refer to all the libraries (modules) in the libs folder how can I
> achieve that:
> require 'C:\ironruby\ironruby\Merlin\Main\Languages\Ruby\Libs'
> The above code does not work!
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core

More information about the Ironruby-core mailing list