To add #even? to Fixnum, try this:
class ::Fixnum
  def even? ; self % 2 == 0 ; end
end

(Class declarations in Shoes are all namespaced to the Shoes class -- so
writing `class Fixnum` is equivalent to writing `class ::Shoes::Fixnum`.)

On Thu, Jul 31, 2008 at 10:22 AM, William Morgan <[EMAIL PROTECTED]
> wrote:

> Hi shoesers,
>
> I've just built shoes from git. The behavior I'm seeing now is that when
> any kind of exception is raised within a Shoes.app block, it's silently
> ignored and the app terminates, but shoes keeps running. Exceptions
> raised outside of the Shoes.app block do generate the nice error
> message.
>
> E.g. the following code:
>  Shoes.app do
>    puts "in app"
>    stack do
>      puts "in stack"
>      raise NoMethodError, "potato"
>    end
>    puts "out of stack"
>  end
>  puts "out of app"
>
> Prints:
>  out of app  # ok we're threading i suppose
>  in app
>  in stack
>
> And then the Shoes window sits there empty.
>
> I ran into this because shit.rb calls Fixnum#even?, and apparently
> that's not defined in my particular Rubies, or something, so all I get
> is a blank window.
>
> (And explicitly adding that method to Fixnum doesn't help for some
> reason...)
>
> Is this normal?
> --
> William <[EMAIL PROTECTED]>
>

Reply via email to