summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-07-18 11:36:21 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-07-18 12:25:55 +0900
commit56c8dab46891bb21b637ec64903bb0a38bb5d2a3 (patch)
treeff4c37499293e11320c6ea8fc8f96f865ca99420 /ext
parent9f51810f340afca45257043cf1a5955da0379836 (diff)
[flori/json] Skip BigDecimal tests when it's missing to load
https://github.com/flori/json/commit/3dd36c6077
Diffstat (limited to 'ext')
-rw-r--r--ext/json/lib/json/add/bigdecimal.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/json/lib/json/add/bigdecimal.rb b/ext/json/lib/json/add/bigdecimal.rb
index c8b4f567cb..25383f28ed 100644
--- a/ext/json/lib/json/add/bigdecimal.rb
+++ b/ext/json/lib/json/add/bigdecimal.rb
@@ -2,7 +2,10 @@
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
-defined?(::BigDecimal) or require 'bigdecimal'
+begin
+ require 'bigdecimal'
+rescue LoadError
+end
class BigDecimal
# Import a JSON Marshalled object.
@@ -26,4 +29,4 @@ class BigDecimal
def to_json(*args)
as_json.to_json(*args)
end
-end
+end if defined?(::BigDecimal)