[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: fyi : rexml eruby cache'ing

paul vudmaska

9/13/2003 5:43:00 AM

>>

There are two Ruby idioms that you may prefer to this.

1. File.open with a block:

globalXML = nil
File.open("xml/global.xml") do |f|
globalXML = REXML::Document.new(f)
end

This implicitly closes the file at the end of the
block.

2. File.read:

globalXML =
REXML::Document.new(File.read("xml/global.xml"))
<<

Thanks for the tips! File.read, this will be ideal for
me!



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder...