2009/1/29 Szymon Wrozynski <[email protected]>: > Have you checked it? ;) > > Wiadomość napisana w dniu 2009-01-29, o godz. 06:13, przez Seth Thomas > Rasmussen: >> >> This isn't a Shoes bug. It's normal Ruby behavior. Think about what >> you said about Outer2. In the first example, Inner is defined at the >> top level, so referencing it anywhere is no problem. In the second, it >> is within Outer, but you reference it within Outer::Foo. Notice where >> Ruby thinks Inner should be in the error message from the second >> example. > > Replace the "Shoes.app do ... end" block with simple "puts > Outer::Foo.getBoo.inspect". It will work without problems under standard > ruby interpreter (1.8.7p72 in my case). > >> >> If the second example's getBoo were to reference Outer::Inner, that would >> work. > > Nope. It wouldn't. Just check it. The only difference will be in the > "uninitialized constant" name...
My bad. Didn't check thoroughly. And forgot the eternally confusing behavior of the way the main app file is evaluated. If it's defined in another file, it's normal. In the app file, everything is believed to be in the context of Shoes. So, ::Outer should work from the main app file. This is arguably a Shoes bug. It seems to confuse a lot of people. It confused me at first, too. And obviously I still forget about it once in a while. ;) -- Seth Thomas Rasmussen http://greatseth.com
