[ruby/yaml] Make PStore support as optional
https://github.com/ruby/yaml/commit/da421ce46f
This commit is contained in:
parent
7c8f9603b1
commit
3de2ab7fdb
@ -3,7 +3,11 @@
|
|||||||
# YAML::Store
|
# YAML::Store
|
||||||
#
|
#
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
require 'pstore'
|
|
||||||
|
begin
|
||||||
|
require 'pstore'
|
||||||
|
rescue LoadError
|
||||||
|
end
|
||||||
|
|
||||||
# YAML::Store provides the same functionality as PStore, except it uses YAML
|
# YAML::Store provides the same functionality as PStore, except it uses YAML
|
||||||
# to dump objects instead of Marshal.
|
# to dump objects instead of Marshal.
|
||||||
@ -83,4 +87,4 @@ class YAML::Store < PStore
|
|||||||
def empty_marshal_checksum
|
def empty_marshal_checksum
|
||||||
CHECKSUM_ALGO.digest(empty_marshal_data)
|
CHECKSUM_ALGO.digest(empty_marshal_data)
|
||||||
end
|
end
|
||||||
end
|
end if defined?(::PStore)
|
||||||
|
@ -177,4 +177,4 @@ class YAMLStoreTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
assert_equal(indentation_3_yaml, File.read(@yaml_store_file), bug12800)
|
assert_equal(indentation_3_yaml, File.read(@yaml_store_file), bug12800)
|
||||||
end
|
end
|
||||||
end
|
end if defined?(::YAML::Store)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user