From: David Vallner Date: 2006-02-22T10:12:47+09:00 Subject: Re: FILE test Dňa Utorok 21 Február 2006 20:25 Damphyr napísal: > Peter Hickman wrote: > > You will see this sort of thing in other scripting languages. __FILE__ > > contains the name of the file source file and $0 is the name of the > > currently executing script. So a file called hello.rb > > ... > > > when you run tom.rb the __FILE__ == $0 part of hello does not run as the > > file hello.rb but the currently executing script is tom.rb. This allows > > you to have a ruby file hold the class for inclusion by other scripts > > and also be a utility script in it's own right. > > Not to mention the fact that it allows you to easily write unit tests > for most of the code in a script. > Which I personally can't bear the sight of. Library is script is test? Nuh-uh. Just my two cents. David Vallner