This updates also borrows some important bugfixes from Ruby CVS that is not available in patchlevel 160 yet. - Drop GC patch support. It is broken with the new ruby version and seem to require the complete rewriting.
40 lines
864 B
Plaintext
40 lines
864 B
Plaintext
--- lib/ostruct.rb 2009/05/26 11:54:29 23578
|
|
+++ lib/ostruct.rb 2009/05/26 12:00:44 23579
|
|
@@ -111,25 +111,23 @@
|
|
def inspect
|
|
str = "#<#{self.class}"
|
|
|
|
- Thread.current[InspectKey] ||= []
|
|
- if Thread.current[InspectKey].include?(self) then
|
|
- str << " ..."
|
|
- else
|
|
+ ids = (Thread.current[InspectKey] ||= [])
|
|
+ if ids.include?(object_id)
|
|
+ return str << ' ...>'
|
|
+ end
|
|
+
|
|
+ ids << object_id
|
|
+ begin
|
|
first = true
|
|
for k,v in @table
|
|
str << "," unless first
|
|
first = false
|
|
-
|
|
- Thread.current[InspectKey] << v
|
|
- begin
|
|
- str << " #{k}=#{v.inspect}"
|
|
- ensure
|
|
- Thread.current[InspectKey].pop
|
|
- end
|
|
+ str << " #{k}=#{v.inspect}"
|
|
end
|
|
+ return str << '>'
|
|
+ ensure
|
|
+ ids.pop
|
|
end
|
|
-
|
|
- str << ">"
|
|
end
|
|
alias :to_s :inspect
|
|
|