Skip to content

Commit 5c81ba2

Browse files
jhawthornmatzbot
authored andcommitted
[ruby/rubygems] Make SafeYAML.load an alias of safe_load
Using Psych, load was actually more restrictive than safe_load. Using Gem::YAMLSerializer they were identical. We might as well use the same path for both methods. ruby/rubygems@d8d927f889
1 parent d66f8d4 commit 5c81ba2

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

lib/rubygems/safe_yaml.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,8 @@ def self.safe_load(input)
4848
end
4949
end
5050

51-
def self.load(input)
52-
if Gem.use_psych?
53-
::Psych.safe_load(input, permitted_classes: [::Symbol])
54-
else
55-
Gem::YAMLSerializer.load(
56-
input,
57-
permitted_classes: PERMITTED_CLASSES,
58-
permitted_symbols: PERMITTED_SYMBOLS,
59-
aliases: aliases_enabled?
60-
)
61-
end
51+
class << self
52+
alias_method :load, :safe_load
6253
end
6354
end
6455
end

0 commit comments

Comments
 (0)