diff options
author | Markus Roberts <Markus@reality.com> | 2010-03-22 22:24:22 -0700 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 4820a1b569444f942b3ceb6ee3a0832ed6faf613 (patch) | |
tree | 3acd2a663eaf33c0dd691076e2ae91ebfa3c8f31 /lib/puppet/util/monkey_patches.rb | |
parent | 1c5b3d7d4457a7c2e643a3ac160a95f14b347397 (diff) | |
download | puppet-4820a1b569444f942b3ceb6ee3a0832ed6faf613.tar.gz puppet-4820a1b569444f942b3ceb6ee3a0832ed6faf613.tar.xz puppet-4820a1b569444f942b3ceb6ee3a0832ed6faf613.zip |
Fix for #2604 Pure Ruby yaml generation
This patch brings in a pure ruby yaml generation library, analagous
to what we did with JSON/PSON, but without the renaming dodge we had
to do in that case to avoid fighting with Rails.
Signed-off-by: Markus Roberts <Markus@reality.com>
Diffstat (limited to 'lib/puppet/util/monkey_patches.rb')
-rw-r--r-- | lib/puppet/util/monkey_patches.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb index 7ce1ccc1c..05d319356 100644 --- a/lib/puppet/util/monkey_patches.rb +++ b/lib/puppet/util/monkey_patches.rb @@ -1,4 +1,5 @@ Process.maxgroups = 1024 + module RDoc def self.caller(skip=nil) in_gem_wrapper = false @@ -7,3 +8,27 @@ module RDoc } end end + + +require "yaml" +require "puppet/util/zaml.rb" + +class Symbol + def to_zaml(z) + z.emit("!ruby/sym ") + to_s.to_zaml(z) + end +end + +class Object + def to_yaml + ZAML.dump(self) + end +end + +def YAML.dump(*args) + ZAML.dump(*args) +end + + + |