lib/yard/serializers/yardoc_serializer.rb in yard-0.6.4 vs lib/yard/serializers/yardoc_serializer.rb in yard-0.6.5
- old
+ new
@@ -59,11 +59,15 @@
end
File.join('objects', path)
end
def serialize(object)
- super(object, dump(object))
+ if Hash === object
+ super(object[:root], dump(object)) if object[:root]
+ else
+ super(object, dump(object))
+ end
end
def deserialize(path, is_path = false)
path = File.join(basepath, serialized_path(path)) unless is_path
if File.file?(path)
@@ -76,10 +80,11 @@
end
private
def dump(object)
- Marshal.dump(internal_dump(object, true))
+ object = internal_dump(object, true) unless object.is_a?(Hash)
+ Marshal.dump(object)
end
def internal_dump(object, first_object = false)
if !first_object && object.is_a?(CodeObjects::Base) &&
!(Tags::OverloadTag === object)
\ No newline at end of file