Holy freaking horribleness. I can only trust you on this one; I'm not willing to say I like it. If you say this is what we should use...
On Sep 28, 2009, at 11:39 AM, Markus Roberts wrote: > > This reduces the cases of #2615 to the level that were present in > 0.24.x by removing the optional (and problematic) domain-boundary > "\n"s in the generated yaml. This means the only times serialized > text values should pick up an additional trailing "\n" is if they > contain two or more trailing "\n" to start with and either occur > at the very end of the stream or directly before a Regex or DateTime > used as a Hash key (i.e. we should almost never see it). > > Signed-off-by: Markus Roberts <[email protected]> > --- > lib/puppet/network/formats.rb | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/lib/puppet/network/formats.rb b/lib/puppet/network/ > formats.rb > index 3a19b0b..ef0d9f7 100644 > --- a/lib/puppet/network/formats.rb > +++ b/lib/puppet/network/formats.rb > @@ -34,8 +34,9 @@ Puppet::Network::FormatHandler.create(:yaml, :mime > => "text/yaml") do > # fixup invalid yaml as per: > # http://redmine.ruby-lang.org/issues/show/1331 > def fixup(yaml) > - yaml.gsub!(/((?:&id\d+\s+)?!ruby\/object:.*?)\s*\?/) { "? > #{$1}" } > - yaml > + yaml. > + gsub(/((?:&id\d+\s+)?!ruby\/object:.*?)\s*\?/) { "? > #{$1}" }. > + gsub(/\n?(\n\s*)\? (!ruby\/sym\s+.+)\n\s*:/) > { "#{$1}#{$2}:" } > end > end > > -- > 1.6.4 > > > > -- A conservative is a man who believes that nothing should be done for the first time. --Alfred E. Wiggam --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
