lib/syck.rb in syck-1.0.1 vs lib/syck.rb in syck-1.0.3
- old
+ new
@@ -5,10 +5,19 @@
#
# Author:: why the lucky stiff
#
require 'yaml/syck'
-require File.expand_path('../yaml/engine_manager', __FILE__)
+if defined?(YAML::ENGINE)
+ require File.expand_path('../yaml/engine_manager', __FILE__)
+else
+ Object.class_eval <<-eorb, __FILE__, __LINE__ + 1
+ remove_const 'YAML' if defined? YAML
+ YAML = Syck
+ remove_method :to_yaml
+ alias :to_yaml :syck_to_yaml
+ eorb
+end
# == YAML
#
# YAML(tm) (rhymes with 'camel') is a
# straightforward machine parsable data serialization format designed for