No need to check if YAML::ENGINE is defined since ruby 1.9 does that
This commit is contained in:
parent
e2e4216d64
commit
0bf51e9805
@ -319,7 +319,7 @@ def inspect
|
|||||||
|
|
||||||
# Hackery to accomodate Syck. Remove for 4.0.
|
# Hackery to accomodate Syck. Remove for 4.0.
|
||||||
def to_yaml(opts = {}) #:nodoc:
|
def to_yaml(opts = {}) #:nodoc:
|
||||||
if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
|
if !YAML::ENGINE.syck?
|
||||||
super
|
super
|
||||||
else
|
else
|
||||||
coder = {}
|
coder = {}
|
||||||
|
@ -16,7 +16,7 @@ class BigDecimal
|
|||||||
#
|
#
|
||||||
# Note that reconstituting YAML floats to native floats may lose precision.
|
# Note that reconstituting YAML floats to native floats may lose precision.
|
||||||
def to_yaml(opts = {})
|
def to_yaml(opts = {})
|
||||||
return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
|
return super if !YAML::ENGINE.syck?
|
||||||
|
|
||||||
YAML.quick_emit(nil, opts) do |out|
|
YAML.quick_emit(nil, opts) do |out|
|
||||||
string = to_s
|
string = to_s
|
||||||
|
@ -137,7 +137,7 @@ def encode_with(coder)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_yaml(*args)
|
def to_yaml(*args)
|
||||||
return super() if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
|
return super() if !YAML::ENGINE.syck?
|
||||||
to_str.to_yaml(*args)
|
to_str.to_yaml(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ def encode_with(coder)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_yaml(opts = {})
|
def to_yaml(opts = {})
|
||||||
if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
|
if !YAML::ENGINE.syck?
|
||||||
return super
|
return super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ def encode_with(coder)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_yaml(options = {})
|
def to_yaml(options = {})
|
||||||
return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
|
return super if !YAML::ENGINE.syck?
|
||||||
|
|
||||||
utc.to_yaml(options)
|
utc.to_yaml(options)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user