You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def not_in_shoes_app
STDERR.puts "Self: #{self.inspect}"
button "Oops! Doesn't work"
end
Shoes.app do
background blue
not_in_shoes_app
end
This shouldn't work. The method should be defined on Ruby's main object, not on Shoes.app. It's happening because we eval the block inside the Shoes app instance, which is wrong.
The text was updated successfully, but these errors were encountered:
Huh. Okay, so the top level stuff is not defined on Shoes::App. But a top-level method, which can be called from anywhere (like how stuff in Kernel works) will cheerfully be called with whatever the old self variable was. So this isn't a Shoes or Scarpe bug, though you could maybe make the case that it's a Ruby bug.
I need to investigate Shoes3 TOPLEVEL_BINDING stuff (that's a Ruby constant, but Shoes uses it in several places for evals.) I'm not sure if that would fix this problem, or if it would do exactly what our current use of "load" does.
Oops!
This shouldn't work. The method should be defined on Ruby's main object, not on Shoes.app. It's happening because we eval the block inside the Shoes app instance, which is wrong.
The text was updated successfully, but these errors were encountered: