]> git.cworth.org Git - sup/commitdiff
bugfix in yaml serialization
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Fri, 4 Sep 2009 15:14:07 +0000 (11:14 -0400)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Fri, 4 Sep 2009 15:14:07 +0000 (11:14 -0400)
Objects that don't respond to before_marshal were being turned into false.
Whoops!

lib/sup.rb

index 2351fa586418448cc8efb7e91c60a82c95c4ae21..aa8079c488edd0976eb966d1aa8f7dac956dd866 100644 (file)
@@ -88,8 +88,10 @@ module Redwood
   def save_yaml_obj o, fn, safe=false
     o = if o.is_a?(Array)
       o.map { |x| (x.respond_to?(:before_marshal) && x.before_marshal) || x }
+    elsif o.respond_to? :before_marshal
+      o.before_marshal
     else
-      o.respond_to?(:before_marshal) && o.before_marshal
+      o
     end
 
     if safe