On Mon, Sep 29, 2008 at 9:44 PM, Jeff Hodges <[EMAIL PROTECTED]> wrote:
> Hey,
> Sorry, should have included that info.
>
> The error raised when using require with a widget inheriting from
> Shoes::Widget is:
>
> private method 'gsub' called for nil:NilClass
Yes, I think this is because of how the dynamic methods for making
widgets are created. It assumes everything is defined within Shoes
e.g. Shoes::Wodgetizer.
def Widget.inherited subc
Shoes.class_eval %{
def #{subc.to_s[/::(\w+)$/, 1].
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase}(*a, &b)
a.unshift #{subc}
widget(*a, &b)
end
}
end
So, considering an example class name like "Wodgetizer", without the
Shoes namespace, I think the gsub error is when
"Wodgetizer"[/::(\w+)$/, 1] returns nil.
--
Seth Thomas Rasmussen
http://greatseth.com