Activerecord status with r110

As a supplement to Wayne’s work with “gems setup.rb”, here is a quick
status update with “require ‘active_record’” with r110. The following
bugs or unimplemented features are currently blocking active_record from
loading correctly:

(1) define_method overload not implemented - bug #20119
(2) Thread.critical= not implemented
(3) Regexp.new overloads not implemented (see Wayne’s email)
(4) require infinite loop - bug #20131
(5) Kernel.caller not implemented
(6) Dir.glob pattern bug #19843, #19950
(7) Array.pack not implemented
(8) Class variable assignment expression bug (e.g. @@x ||= 123) - bug
#19901
(9) bigdecimal not implemented

I have managed to get “require ‘active_record’” to work by applying my
own patches and workarounds for the above issues. I will try to get some
simple activerecord use cases up and running shortly…

-Brian

Do you have any feeling for how these programs are using
thread.critical=?

On Fri, 16 May 2008 14:54:32 -0700, “Curt H.”
[email protected] said:

Do you have any feeling for how these programs are using
thread.critical=?

It’s used by just one method in activesupport, instance_exec (which
seems to be a built-in method in Ruby 1.9). Here is the method from
active_support\core_ext\object\extending.rb:

unless defined? instance_exec # 1.9
module InstanceExecMethods #:nodoc:
end
include InstanceExecMethods

# Evaluate the block with the given arguments within the context of
# this object, so self is set to the method receiver.
#
# From Mauricio's
http://eigenclass.org/hiki/bounded+space+instance_exec
def instance_exec(*args, &block)
  begin
    old_critical, Thread.critical = Thread.critical, true
    n = 0
    n += 1 while respond_to?(method_name = "__instance_exec#{n}")
    InstanceExecMethods.module_eval { define_method(method_name,
    &block) }
  ensure
    Thread.critical = old_critical
  end

  begin
    send(method_name, *args)
  ensure
    InstanceExecMethods.module_eval { remove_method(method_name) }
    rescue nil
  end
end

end

Cheers,
Brian

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs