|
From: Masao M. <mu...@hi...> - 2004-02-04 03:03:57
|
Hi,
On 02 Feb 2004 13:24:16 -0500
Archit Baweja <bi...@us...> wrote:
> Ok here's the changed patch with the "SUPAH DUPAH" (As I so eloquently put it
> :-D) out of it. Changed #widget_names to use regular expressions.
Thanks. Applied.
And I improved it to cache the method names.
def widget_names(nocache = false)
@widget_names = [] if nocache || ! @widget_names
if @widget_names.size == 0
regexp = Regexp.new("<widget class=\".*\" id=\"(.*)\"")
IO.readlines(filename).each { |line|
if md = regexp.match(line)
@widget_names << md[1]
end
}
end
@widget_names
end
--
.:% Masao Mutoh<mu...@hi...>
|