Skip to content

Commit

Permalink
Fix deprecated interface for YAML.safe_load
Browse files Browse the repository at this point in the history
Passing in the permitted classes as the second argument was deprecated
in Psych 3 (ruby/psych#378) and removed in
Psych 4 (ruby/psych#487).

Ruby 3.1 ships with Psych 4, so to make the code work for Ruby 2.7 and
up, use the `permitted_classes` keyword argument.
  • Loading branch information
stanhu committed Mar 13, 2023
1 parent 9cb5afc commit e8f25f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/kramdown
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ end.parse!

begin
if config_file && File.exist?(config_file)
config_file_options = YAML.safe_load(File.read(config_file), [Symbol])
config_file_options = YAML.safe_load(File.read(config_file), permitted_classes: [Symbol])
case config_file_options
when nil # empty configuration file except perhaps YAML header and comments
# Nothing to do
Expand Down

0 comments on commit e8f25f2

Please sign in to comment.