summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/exception.rb
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2021-05-19 16:07:24 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-06-07 19:15:14 +0900
commitfd6225c7a974e5154099c9f7be82bebd44a19116 (patch)
treed68741ae9aed69894c2475c75c47b935088b845d /ext/psych/lib/psych/exception.rb
parent430883158f3d01f80917d6eefbaa82521c95c05a (diff)
[ruby/psych] Implement YAML.safe_dump to make safe_load more usable.
In case where Psych is used as a two way serializers, e.g. to serialize some cache or config, it is preferable to have the same restrictions on both load and dump. Otherwise you might dump and persist some objects payloads that you later won't be able to read. https://github.com/ruby/psych/commit/441958396f
Diffstat (limited to 'ext/psych/lib/psych/exception.rb')
-rw-r--r--ext/psych/lib/psych/exception.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/psych/lib/psych/exception.rb b/ext/psych/lib/psych/exception.rb
index fac0c42b9fb..f473b95a3bb 100644
--- a/ext/psych/lib/psych/exception.rb
+++ b/ext/psych/lib/psych/exception.rb
@@ -7,8 +7,8 @@ module Psych
end
class DisallowedClass < Exception
- def initialize klass_name
- super "Tried to load unspecified class: #{klass_name}"
+ def initialize action, klass_name
+ super "Tried to #{action} unspecified class: #{klass_name}"
end
end
end