Support Requests: Browse | Submit New | Admin

[#19549] Errors when ObjectSpace is disabled

Date:
2008-04-15 18:21
Priority:
3
Submitted By:
Ian Dickinson (ijdickinson)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Errors when ObjectSpace is disabled

Detailed description
As I understand it, it is now the default for ObjectSpace to be disabled in Ruby. I'm trying to generate Atom feeds
programatically, and I keep getting an error that:

RuntimeError: ObjectSpace is disabled; each_object will only work with Class, pass +O to enable

For example:

irb(main):003:0> item = FeedTools::FeedItem.new()
RuntimeError: ObjectSpace is disabled; each_object will only work with Class, pass +O to enable
        from /home/ijd/java/jruby-1.1RC1/lib/ruby/gems/1.8/gems/feedtools-0.2.29/lib/feed_tools/feed_item.rb:67:in
`feed'

This particular error comes via inspect(), but even if I patch the class so that inspect does not break, I still have
problems:

item = FeedTools::FeedItem.new()
=> temp inspection
irb(main):010:0> item.id = "urn:uuid:item-1"
=> "urn:uuid:item-1"
irb(main):011:0> item.title = "some item title"
=> "some item title"
irb(main):012:0> feed = FeedTools::Feed.new
=> #<FeedTools::Feed:0x384 URL:>
irb(main):013:0> feed.id = "urn:uuid:feed-1"
=> "urn:uuid:feed-1"

irb(main):015:0> feed << item
=> [temporarily patched inspect()]

irb(main):016:0> feed.build_xml
RuntimeError: ObjectSpace is disabled; each_object will only work with Class, pass +O to enable
/home/ijd/java/jruby-1.1RC1/lib/ruby/gems/1.8/gems/feedtools-0.2.29/lib/feed_tools/feed_item.rb:67:in `feed'

As I understand it, turning on ObjectSpace with +O will cause a significant performance hit, so I'd prefer not to do
that. In any case, since the default is no ObjectSpace, it would seem prudent for feed_tools to not require it out-of-the
box.

Thanks,
Ian

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item