diff --git a/bin/sup-config b/bin/sup-config index c4a64a316..d568e1364 100755 --- a/bin/sup-config +++ b/bin/sup-config @@ -2,7 +2,6 @@ require 'rubygems' require 'highline/import' -require 'yaml' require 'trollop' require "sup" diff --git a/lib/sup.rb b/lib/sup.rb index 1c34356fa..f8e0eccc7 100644 --- a/lib/sup.rb +++ b/lib/sup.rb @@ -1,6 +1,9 @@ require 'rubygems' + require 'syck' require 'yaml' +YAML::ENGINE.yamler = 'syck' + require 'zlib' require 'thread' require 'fileutils' diff --git a/test/test_yaml_regressions.rb b/test/test_yaml_regressions.rb new file mode 100644 index 000000000..8e3bcf66a --- /dev/null +++ b/test/test_yaml_regressions.rb @@ -0,0 +1,17 @@ +require 'test/unit' + +# Requiring 'yaml' before 'sup' in 1.9.x would get Psych loaded first +# and becoming the default yamler. +require 'yaml' +require 'sup' + +module Redwood + class TestYamlRegressions < Test::Unit::TestCase + def test_yamling_hash + hsh = {:foo => 42} + reloaded = YAML.load(hsh.to_yaml) + + assert_equal reloaded, hsh + end + end +end