Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

@_rails_html_safe clutters up YAML

#3545

I'm writing an HTML importer in Ruby that is not related to Rails.

One of my dependencies includes ActiveSupport 2.3.5. It sets @_rails_html_safe to false, which clutters up some YAML files i'm exporting.

My goal is to have clean YAML, so my workaround is to use remove_instance_variable:

http://gist.github.com/250891

Reported by David James · December 7th, 2009 @ 04:14 PM

State: duplicate
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. David James
    David James

    On one hand, I understand that if I include ActiveSupport, then I am going to get all the monkey patching that comes with it. On another hand, adding instance variables to String seems a bit intrusive. Is there another way that ActiveSupport could do this? Or is there a better workaround from my perspective?

    December 7th, 2009 @ 04:17 PM

  2. is
    is

    The same problem with write_fragment to memcached from action and read it from nginx/memcached: I" and :@_rails_html_safeF around html.

    December 23rd, 2009 @ 08:17 PM

  3. is
    is

    Sorry, my problem can be fixed by adding :raw => true to write_fragment.

    December 23rd, 2009 @ 09:19 PM

  4. Lenary
    Lenary

    david, how does that monkey-patch work? i can't find any documentation for Utility.raw_string anywhere (moreover, i can't find any documentation for the module Utility)

    April 22nd, 2010 @ 09:42 PM

  5. David James
    David James

    Lenary: you mean plain_string (not raw_string) from http://gist.github.com/250891 -- it is not a monkey patch; it is just a convenience method. Use it like this: Utility.plain_string(str)

    April 22nd, 2010 @ 09:55 PM

  6. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to duplicate

    duplicates #3535

    April 22nd, 2010 @ 10:31 PM

  7. Lenary
    Lenary

    yeah, but is that called automatically from within YAML, or do you call it yourself?

    April 22nd, 2010 @ 10:32 PM