Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
diff --git a/kernel/core/context.rb b/kernel/core/context.rb index 599a77f..d2cf43a 100644 --- a/kernel/core/context.rb +++ b/kernel/core/context.rb @@ -235,9 +235,8 @@ class MethodContext scope = method.staticscope while scope - if mod = scope.module.__send__(:recursive_const_get, top, false) - return mod.const_path_defined? parts.join("::") - end + mod = top.to_s !~ /self/ ? scope.module.__send__(:recursive_const_get, top, false) : scope.module + return mod.const_path_defined? parts.join("::") if mod scope = scope.parent end
This paste will be private.
From the Design Piracy series on my blog: