[MacRuby] #1238: Does not find any methods in Module#remove_method
#1238: Does not find any methods in Module#remove_method ------------------------------+--------------------------------------------- Reporter: kouji@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- reduction: {{{ $ macruby -e 'Module.new { instance_methods.each { |selector| remove_method(selector) } }' -e:1:in `block': method `to_plist' not defined in #<Class:0x20004ad00> (NameError) from -e:1:in `block' from -e:1:in `<main>' $ ruby -e 'Module.new { instance_methods.each { |selector| remove_method(selector) } }' (not raise an exception) }}} This is use in Rails(actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:94). -- Ticket URL: <http://www.macruby.org/trac/ticket/1238> MacRuby <http://macruby.org/>
#1238: Does not find any methods in Module#remove_method ------------------------------+--------------------------------------------- Reporter: kouji@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(by kouji@…): Oh, I understood this issue. Module has many instance methods in MacRuby, but CRuby does not. {{{ $ macruby -e 'p Module.new.instance_methods' [:to_plist, :Complex, :Rational, :enum_for, :to_enum, :object_id, :__id__, :define_singleton_method, :public_method, :method, :extend, :respond_to_missing?, :respond_to?, :public_send, :send, :__send__, :instance_exec, :instance_eval, :__callee__, :__method__, :tap, :is_a?, :kind_of?, :instance_of?, :instance_variable_defined?, :instance_variable_set, :instance_variable_get, :instance_variables, :public_methods, :private_methods, :protected_methods, :singleton_methods, :methods, :inspect, :to_s, :untrusted?, :untrust, :trust, :frozen?, :freeze, :untaint, :tainted?, :taint, :__type__, :dup, :clone, :<=>, :eql?, :!~, :=~, :===, :nil?, :!=, :!, :==, :equal?] $ ruby -e 'p Module.new.instance_methods' [] }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1238#comment:2> MacRuby <http://macruby.org/>
#1238: Does not find any methods in Module#remove_method ------------------------------+--------------------------------------------- Reporter: kouji@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Changes (by lsansonetti@…): * milestone: MacRuby 1.0 => Comment: Because these methods are added on NSObject which is the superclass of Module. -- Ticket URL: <http://www.macruby.org/trac/ticket/1238#comment:3> MacRuby <http://macruby.org/>
#1238: Does not find any methods in Module#remove_method ------------------------------+--------------------------------------------- Reporter: kouji@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(by lsansonetti@…): #remove_method raises an exception in case we try to remove a method from a class where the method was not originally defined in (in this case, the methods are defined on NSObject, not Module). -- Ticket URL: <http://www.macruby.org/trac/ticket/1238#comment:4> MacRuby <http://macruby.org/>
#1238: Does not find any methods in Module#remove_method ------------------------------+--------------------------------------------- Reporter: kouji@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(by lsansonetti@…): {{{ $ ruby1.9 -e "p Module.new.ancestors" [#<Module:0xb79800>] $ ./miniruby -e "p Module.new.ancestors" [#<Class:0x40021dd00>, NSObject, Kernel] }}} I'm afraid we will have to hardcode some logic here for this special case. Strangely enough, Class is different. {{{ $ ruby1.9 -e "p Class.new.ancestors" [#<Class:0xb3f600>, Object, Kernel, BasicObject] }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1238#comment:5> MacRuby <http://macruby.org/>
#1238: Does not find any methods in Module#remove_method ------------------------------+--------------------------------------------- Reporter: kouji@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.11 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------+--------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.11 Comment: Should be fixed in https://github.com/MacRuby/MacRuby/commit/bfcea02f4036e5fb7c7f674564c9f8cf6e... -- Ticket URL: <http://www.macruby.org/trac/ticket/1238#comment:6> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby