class Object

See the discussion here: eigenclass.org/hiki.rb?instance_exec

Constants

APPLICATION_ROOT

Do not change this file!

This was mainly copied (but modified a little bit) from the rails framework initializers, but made less picky about gem loading.

RUGUI_ENV

Defines the environment to be used by the application.

Public Instance Methods

instance_exec(*args, &block) click to toggle source
# File lib/rugui/framework_adapters/GTK.rb, line 9
def instance_exec(*args, &block)
  begin
    old_critical, Thread.critical = Thread.critical, true
    n = 0
    n += 1 while respond_to?(mname="__instance_exec#{n}")
    InstanceExecHelper.module_eval{ define_method(mname, &block) }
  ensure
    Thread.critical = old_critical
  end
  begin
    ret = send(mname, *args)
  ensure
    InstanceExecHelper.module_eval{ remove_method(mname) } rescue nil
  end
  ret
end