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.
|
||||
def to_yaml(opts = {}) #:nodoc:
|
||||
if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
|
||||
if !YAML::ENGINE.syck?
|
||||
super
|
||||
else
|
||||
coder = {}
|
||||
|
@ -16,7 +16,7 @@ class BigDecimal
|
||||
#
|
||||
# Note that reconstituting YAML floats to native floats may lose precision.
|
||||
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|
|
||||
string = to_s
|
||||
|
@ -137,7 +137,7 @@ def encode_with(coder)
|
||||
end
|
||||
|
||||
def to_yaml(*args)
|
||||
return super() if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
|
||||
return super() if !YAML::ENGINE.syck?
|
||||
to_str.to_yaml(*args)
|
||||
end
|
||||
|
||||
|
@ -30,7 +30,7 @@ def encode_with(coder)
|
||||
end
|
||||
|
||||
def to_yaml(opts = {})
|
||||
if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
|
||||
if !YAML::ENGINE.syck?
|
||||
return super
|
||||
end
|
||||
|
||||
|
@ -147,7 +147,7 @@ def encode_with(coder)
|
||||
end
|
||||
|
||||
def to_yaml(options = {})
|
||||
return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
|
||||
return super if !YAML::ENGINE.syck?
|
||||
|
||||
utc.to_yaml(options)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user