summaryrefslogtreecommitdiffstats
path: root/rubygem-sitemap_generator-5.3.1-Fix-Ruby-2.0.0-compatibility.patch
blob: 8e9a214ac2074c0c58612ff9f007ba08fc6f2dc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 7ed62817d6e249751aedd6145aaeda1385e98b14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Mon, 11 Sep 2017 17:18:40 +0200
Subject: [PATCH] Fix Ruby 2.0.0+ compatibility.

YAML::ENGINE is not available since Ruby 2.0.0+, when Syck was removed
from stdlib and replaced by Psych.
---
 lib/sitemap_generator/core_ext/big_decimal.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/sitemap_generator/core_ext/big_decimal.rb b/lib/sitemap_generator/core_ext/big_decimal.rb
index fa96550..7920edb 100644
--- a/lib/sitemap_generator/core_ext/big_decimal.rb
+++ b/lib/sitemap_generator/core_ext/big_decimal.rb
@@ -19,7 +19,7 @@ class SitemapGenerator::BigDecimal < 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 unless defined?(YAML::ENGINE) && YAML::ENGINE.syck?
 
     YAML.quick_emit(nil, opts) do |out|
       string = to_s
-- 
2.14.1