Skip to content
Browse files

The rb_unbound_get_class() in app.c didn't work with Ruby1.9.3p125. S…

…o, added a patch without using the function. Now class-book.rb works.
  • Loading branch information...
1 parent a1d930e commit f1a07acdb2b9937c7cf0d8c082fd04e44b3e087d @ashbb ashbb committed with steveklabnik Mar 5, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 lib/shoes.rb
  2. +2 −1 shoes/app.c
View
2 lib/shoes.rb
@@ -371,7 +371,7 @@ def self.run(path)
unless rout.is_a? Proc
rout = rout[0].instance_method(rout[1])
end
- return [rout, args]
+ return [rout, args, rout.owner]
end
end
case uri.path when "/"
View
3 shoes/app.c
@@ -369,7 +369,8 @@ shoes_app_visit(shoes_app *app, char *path)
exec.block = rb_ary_entry(meth, 0);
exec.args = rb_ary_entry(meth, 1);
if (rb_obj_is_kind_of(exec.block, rb_cUnboundMethod)) {
- VALUE klass = rb_unbound_get_class(exec.block);
+ //VALUE klass = rb_unbound_get_class(exec.block);
+ VALUE klass = rb_ary_entry(meth, 2);
exec.canvas = app->nestslot = shoes_slot_new(klass, ssNestSlot, app->canvas);
exec.block = rb_funcall(exec.block, s_bind, 1, exec.canvas);
exec.ieval = 0;

0 comments on commit f1a07ac

Please sign in to comment.
Something went wrong with that request. Please try again.