summaryrefslogtreecommitdiff
path: root/lib/yaml
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-01-31 11:01:31 +0900
committergit <svn-admin@ruby-lang.org>2024-01-31 05:56:39 +0000
commit3de2ab7fdb5201133718b45dfdeb82f4794f99bc (patch)
treeee39f9c2d3a8e713a427a76fae001bbb22ac66b0 /lib/yaml
parent7c8f9603b1dcacb7f04b559dadac905e167a5cc1 (diff)
[ruby/yaml] Make PStore support as optional
https://github.com/ruby/yaml/commit/da421ce46f
Diffstat (limited to 'lib/yaml')
-rw-r--r--lib/yaml/store.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/yaml/store.rb b/lib/yaml/store.rb
index 88dd1b978c..f24e4ad332 100644
--- a/lib/yaml/store.rb
+++ b/lib/yaml/store.rb
@@ -3,7 +3,11 @@
# YAML::Store
#
require 'yaml'
-require 'pstore'
+
+begin
+ require 'pstore'
+rescue LoadError
+end
# YAML::Store provides the same functionality as PStore, except it uses YAML
# to dump objects instead of Marshal.
@@ -83,4 +87,4 @@ class YAML::Store < PStore
def empty_marshal_checksum
CHECKSUM_ALGO.digest(empty_marshal_data)
end
-end
+end if defined?(::PStore)