Missing defined methods in ruby1.9
tario opened this issue · comments
----------------example.rb-----------------
require "rubygems"
require "shikashi"
include Shikashi
s = Sandbox.new
priv = Privileges.new
allow execution of print
priv.allow_method :print
priv.allow_method "core#define_method".to_sym
priv.allow_method :instance_method
allow definition of classes
priv.allow_class_definitions
inside the sandbox, only can use method foo on main and method times on instances of Fixnum
s.run(priv, '
class X
def foo
print "X#foo\n"
end
end
')
print X.shadow.instance_method(:foo),"\n"
$ ruby1.8 example6.rb
<UnboundMethod: #Class:0x7fa4e82e80d0#foo>
$ ruby1.9 example6.rb
example6.rb:28:in instance_method': undefined method
foo' for class X' (NameError) from example6.rb:28:in
Invalid, there is support for Ruby 1.9 in the latest version