37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
|
|
From 5dcc7a03267216feaa587017ef5d6d075b62f75b Mon Sep 17 00:00:00 2001
|
||
|
|
From: Samuel Giddins <segiddins@segiddins.me>
|
||
|
|
Date: Fri, 9 Feb 2024 10:15:40 -0800
|
||
|
|
Subject: [PATCH] [rubygems/rubygems] Use a writer method on the module instead
|
||
|
|
of a constant
|
||
|
|
|
||
|
|
https://github.com/rubygems/rubygems/commit/240d84eea3
|
||
|
|
---
|
||
|
|
lib/rubygems/safe_yaml.rb | 8 +++++---
|
||
|
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/lib/rubygems/safe_yaml.rb b/lib/rubygems/safe_yaml.rb
|
||
|
|
index 4e1da3c14b..f668e652be 100644
|
||
|
|
--- a/lib/rubygems/safe_yaml.rb
|
||
|
|
+++ b/lib/rubygems/safe_yaml.rb
|
||
|
|
@@ -25,11 +25,13 @@ module SafeYAML
|
||
|
|
runtime
|
||
|
|
].freeze
|
||
|
|
|
||
|
|
- ALIASES = true # :nodoc:
|
||
|
|
- private_constant :ALIASES
|
||
|
|
+ @aliases_enabled = true
|
||
|
|
+ def self.aliases_enabled=(value)
|
||
|
|
+ @aliases_enabled = !!value
|
||
|
|
+ end
|
||
|
|
|
||
|
|
def self.safe_load(input)
|
||
|
|
- ::Psych.safe_load(input, permitted_classes: PERMITTED_CLASSES, permitted_symbols: PERMITTED_SYMBOLS, aliases: ALIASES)
|
||
|
|
+ ::Psych.safe_load(input, permitted_classes: PERMITTED_CLASSES, permitted_symbols: PERMITTED_SYMBOLS, aliases: @aliases_enabled)
|
||
|
|
end
|
||
|
|
|
||
|
|
def self.load(input)
|
||
|
|
--
|
||
|
|
2.33.0
|
||
|
|
|
||
|
|
|