summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-12-20 21:39:56 -0500
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-23 18:35:51 +0900
commit91e1598531833463aadff9537c813e9338504889 (patch)
treed65fc800eea4d8cd2dd07c56ac3a34271946b2c7
parente2a628c7d3e5561940a3ac42239fff70f8e0cda5 (diff)
downloadpsych-91e1598531833463aadff9537c813e9338504889.zip
[ruby/psych] Freeze constants.
Improves Ractor-readiness.
-rw-r--r--lib/psych.rb4
-rw-r--r--lib/psych/class_loader.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/psych.rb b/lib/psych.rb
index c3292d9..347160e 100644
--- a/lib/psych.rb
+++ b/lib/psych.rb
@@ -233,9 +233,9 @@ require 'psych/class_loader'
module Psych
# The version of libyaml Psych is using
- LIBYAML_VERSION = Psych.libyaml_version.join '.'
+ LIBYAML_VERSION = Psych.libyaml_version.join('.').freeze
# Deprecation guard
- NOT_GIVEN = Object.new
+ NOT_GIVEN = Object.new.freeze
private_constant :NOT_GIVEN
###
diff --git a/lib/psych/class_loader.rb b/lib/psych/class_loader.rb
index cfca868..f62798c 100644
--- a/lib/psych/class_loader.rb
+++ b/lib/psych/class_loader.rb
@@ -69,7 +69,7 @@ module Psych
rescue
nil
end
- }.compact]
+ }.compact].freeze
class Restricted < ClassLoader
def initialize classes, symbols