Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Gem::SafeYAML.safe_load
safe_load(input)
lib/rubygems/safe_yaml.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/safe_yaml.rb, line 37
def self.safe_load(input)
# Psych rejects legacy metadata bytes, so preserve them with the internal parser.
if Gem.use_psych? && valid_encoding?(input)
::Psych.safe_load(input, permitted_classes: PERMITTED_CLASSES,
permitted_symbols: PERMITTED_SYMBOLS, aliases: @aliases_enabled)
else
Gem::YAMLSerializer.load(
input,
permitted_classes: PERMITTED_CLASSES,
permitted_symbols: PERMITTED_SYMBOLS,
aliases: aliases_enabled?
)
end
end
No documentation available