We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f83b040 commit da421ceCopy full SHA for da421ce
lib/yaml/store.rb
@@ -3,7 +3,11 @@
3
# YAML::Store
4
#
5
require 'yaml'
6
-require 'pstore'
+
7
+begin
8
+ require 'pstore'
9
+rescue LoadError
10
+end
11
12
# YAML::Store provides the same functionality as PStore, except it uses YAML
13
# to dump objects instead of Marshal.
@@ -83,4 +87,4 @@ def empty_marshal_data
83
87
def empty_marshal_checksum
84
88
CHECKSUM_ALGO.digest(empty_marshal_data)
85
89
end
86
-end
90
+end if defined?(::PStore)
test/yaml/test_store.rb
@@ -177,4 +177,4 @@ def test_with_options
177
178
assert_equal(indentation_3_yaml, File.read(@yaml_store_file), bug12800)
179
180
+end if defined?(::YAML::Store)
0 commit comments