Mohammad Azam
2009-Jun-22 15:26 UTC
[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/.
Jim Deville
2009-Jun-22 15:34 UTC
[Ironruby-core] How to refer to the .rb files in a folder?
Dir.chdir(".") do
Dir["*.rb"].each do |f|
require f
end
end
I don''t know of a way in Ruby to do what you are asking for without
looping through the files.
Thanks,
JD
...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