That did the trick.
Thanks.
Fletch.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Hello Again All,
I have created a couple of large test suites, which use LOTS of requires
require 'dir/test1'
require 'dir/test2'
...
require 'dir/test25'
In an effort to create tidier looking code, is it possible to use something
like Java would have to import, or 'require' all the files in
I use this method:
def require_files_in_dir( start_dir )
files = Dir[ start_dir]
files.each do |f|
require f
end
end
- Original Message -
From: Fletch [EMAIL PROTECTED]
Date: Wednesday, May 30, 2007 9:16 am
Subject: [Wtr-general] 'Require' Lots
Thanks for the reply - not to sound silly at all, but where do I put this
method?
All the require files normally go at the top of the file, but I have tried
putting the code everywhere I can think of and still have had no luck.
--
require
className
def test1
end
def test2
end
end
def require_files_in_dir
end
require_files_in_dir( 'c:\')
require_files_in_dir( 'c:\temp')
- Original Message -
From: Fletch [EMAIL PROTECTED]
Date: Wednesday, May 30, 2007 9:39 am
Subject: Re: [Wtr-general] 'Require' Lots Of Files
Thanks for the reply - not to sound silly
the following in irb
def x ; puts 'x'; end
Object.instance_methods
Paul
- Original Message -
From: Fletch [EMAIL PROTECTED]
Date: Wednesday, May 30, 2007 9:39 am
Subject: Re: [Wtr-general] 'Require' Lots Of Files
Thanks for the reply - not to sound silly at all, but where do I
put
actually it seems you have to use it like this
require_files_in_dir( 'c:\*.rb')
- Original Message -
From: Paul Rogers [EMAIL PROTECTED]
Date: Wednesday, May 30, 2007 9:43 am
Subject: Re: [Wtr-general] 'Require' Lots Of Files
def require_files_in_dir
end
Thanks,
I still can not get it sorted.
My methods are set up in a (java style) static context - FILENAME.methodName,
and when I use the method for the requires, I am getting an uninitialized
constant error message.
___
Wtr-general mailing list
What I do is if I have to require a certain set of files repeatedly, I just
place it in another .rb file and require that .rb file which will in turn
require all of the files you need.
So I would define a file called requirements.rb
and then inside that file place
require 'x'
require
Why not put all those files into a gem?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bach Le
Sent: Wednesday, May 30, 2007 10:30 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] 'Require' Lots Of Files
What I do is if I have to require
Fletch wrote:
I have created a couple of large test suites, which use LOTS of requires
require 'dir/test1'
require 'dir/test2'
...
require 'dir/test25'
In an effort to create tidier looking code, is it possible to use something
like Java would have to import, or 'require' all the files
11 matches
Mail list logo