Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix accessing autoload'ed constants.

  • Loading branch information...
commit 87588a0b99180ecbddaf982486d9f9a2f657d5c2 1 parent eed1505
@mooffie authored
Showing with 8 additions and 3 deletions.
  1. +1 −1  TODO
  2. +5 −0 lib/drx/objinfo.rb
  3. +2 −2 lib/drx/tk/app.rb
View
2  TODO
@@ -5,4 +5,4 @@
== The C extension
-* "require 'extlib'; Extlib.see" crashes.
+--empy--
View
5 lib/drx/objinfo.rb
@@ -51,6 +51,11 @@ def iv_tbl
# @todo: this could be nicer. perhaps define an [] accessor.
def __get_ivar(name)
+ if class_like? and name.to_s =~ /^[A-Z]/
+ # If it's a constant, it may be 'autoloaded'. We
+ # trigger the loading by calling const_get().
+ @obj.const_get(name)
+ end
Core::get_ivar(@obj, name)
end
View
4 lib/drx/tk/app.rb
@@ -233,10 +233,10 @@ def display_variables(obj)
# Get rid of gazillions of Tk classes:
vars = vars.reject { |v| v =~ /Tk|Ttk/ }
vars.each do |name|
- value = if allowed_names.any? { |p| p === name } and name != 'Kconv' # For some reason, Kconv crashes on us when in irb.
+ value = if allowed_names.any? { |p| p === name }
info.__get_ivar(name).inspect
else
- # We don't want to inspect ruby's internal slots (because
+ # We don't want to inspect ruby's internal variables (because
# they may not be Ruby values at all).
''
end
Please sign in to comment.
Something went wrong with that request. Please try again.