From: apeiros@... Date: 2009-11-10T06:50:00+09:00 Subject: Re: FileString - request for comments -------- Original-Nachricht -------- > Datum: Tue, 10 Nov 2009 06:25:08 +0900 > Von: Robert Klemme > Betreff: Re: FileString - request for comments > A good point! You're probably right and I was too pessimistic. I'd > love to see > > fs[/foo(\w+)/, 1] = "bar" > fs.gsub! /foo/, "bar" > > etc. because those would be the ones that would make FileString > convenient for me. :-) Those already exist. Unfortunately optimizing regex matching is too involved as that I could have done that in 24h :) Means fs[/foo(\w+)/, 1] = "bar" is just more convenient than writing: data = File.read data[/foo(\w+)/, 1] = "bar" File.open(path, "w") { |fh| fh.write(data) } But I think that's already quite worth it :) I mean - that's just lots of boilerplate. > Thanks for listening and sharing! Always :D The listening part has made me change the docs btw., I know hint on thinking about performance and probably just use a string and write back when all is done. Regards Stefan -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser