# Builder doesn't play well with IDEs

**URL:** <https://www.ruby-forum.com/t/builder-doesnt-play-well-with-ides/146928>\
**Category:** Rails\
**Created:** [August 26, 2008, 9:47pm UTC](https://www.ruby-forum.com/t/builder-doesnt-play-well-with-ides/146928 "2008-08-26T21:47:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Travers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@Mike\_Travers](https://www.ruby-forum.com/u/Mike_Travers)\
**Post date:** [August 26, 2008, 9:47pm UTC](https://www.ruby-forum.com/t/builder-doesnt-play-well-with-ides/146928/1 "2008-08-26T21:47:17Z")

</div>

I have been doing some stuff with the XML Builder, and running into  
problems whenever I try to debug it with an IDE (trying both Eclipse  
and Netbeans). I believe the problem is that the Builder classes  
remove all the default instance methods from their objects, including  
such basics as .class and .inspect, which breaks the debugger. It  
does this by means of the BlankSlate class, which is also used  
elsewhere in Rails.

I patched Builder to not use BlankSlate, which fixes my problems but  
means I can’t generate XML tags with common method names. That’s OK,  
but not a great fix. I wondered if anybody else has encountered this  
problem and has a better solution. I’ve heard that 1.9 changes this in  
some way.

Oh, and the equality checking methods are also gone! So if you have  
an xml builder object, you can’t do equality checks on it because that  
will insert \<==\> tags into your generated XML. Not good.

---

<div class="post-metadata">

**Author:** ![Mike\_Travers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@Mike\_Travers](https://www.ruby-forum.com/u/Mike_Travers)\
**Post date:** [August 26, 2008, 10:13pm UTC](https://www.ruby-forum.com/t/builder-doesnt-play-well-with-ides/146928/2 "2008-08-26T22:13:41Z")

</div>

To explain what I mean:

$ script/console  
Loading development environment (Rails 2.1.0)

> > xml = Builder::XmlMarkup.new(:indent =\> 1)  
> > =\>
> 
> > xml == nil  
> > =\> “\n\<==\>\</==\>\n”

Yech.

---

<div class="post-metadata">

**Author:** ![Mike\_Travers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@Mike\_Travers](https://www.ruby-forum.com/u/Mike_Travers)\
**Post date:** [August 27, 2008, 4:26pm UTC](https://www.ruby-forum.com/t/builder-doesnt-play-well-with-ides/146928/3 "2008-08-27T16:26:08Z")

</div>

Further discussion at the link. Apparently this bug is considered a  
feature.

[http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/909-xml-builder-redefines-some-methods-that-breaks-things#ticket-909-3](http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/909-xml-builder-redefines-some-methods-that-breaks-things#ticket-909-3)
