diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/ruby.rb | 4 | ||||
-rw-r--r-- | lib/psych/visitors/yast_builder.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/psych/ruby.rb b/lib/psych/ruby.rb index e68632b..6258e81 100644 --- a/lib/psych/ruby.rb +++ b/lib/psych/ruby.rb @@ -1,14 +1,14 @@ require 'complex' require 'rational' +require 'date' [ Object, String, Class, Hash, Array, NilClass, Float, - FalseClass, TrueClass, Range, Complex, Rational + FalseClass, TrueClass, Range, Complex, Rational, Date # Struct # Exception # Regexp # Time - # Date ].each do |klass| klass.send(:remove_method, :to_yaml) rescue NameError end diff --git a/lib/psych/visitors/yast_builder.rb b/lib/psych/visitors/yast_builder.rb index c0396e2..9111f8b 100644 --- a/lib/psych/visitors/yast_builder.rb +++ b/lib/psych/visitors/yast_builder.rb @@ -21,6 +21,10 @@ module Psych raise TypeError, "Can't dump #{target.class}" end + def visit_Date o + append Nodes::Scalar.new o.to_s + end + def visit_Rational o @stack.push append Nodes::Mapping.new(nil,'!ruby/object:Rational',false) ['denominator', o.denominator, 'numerator', o.numerator].each do |m| |