diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2020-12-20 21:39:56 -0500 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-12-23 18:35:51 +0900 |
commit | 91e1598531833463aadff9537c813e9338504889 (patch) | |
tree | d65fc800eea4d8cd2dd07c56ac3a34271946b2c7 | |
parent | e2a628c7d3e5561940a3ac42239fff70f8e0cda5 (diff) | |
download | psych-91e1598531833463aadff9537c813e9338504889.zip |
[ruby/psych] Freeze constants.
Improves Ractor-readiness.
-rw-r--r-- | lib/psych.rb | 4 | ||||
-rw-r--r-- | lib/psych/class_loader.rb | 2 |
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 |