From 58da007819f168af91b741631bb3502e63ce2a4f Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Fri, 7 Oct 2022 08:40:45 -0700 Subject: [PATCH] downgrade Psych for DisallowedClass errors on Time $ bundle exec rake Psych::DisallowedClass: Could not load blog entry file "content/*.readably" Tried to load unspecified class: Time See also https://github.com/ruby/psych/issues/362 --- Gemfile | 1 + Gemfile.lock | 4 +++- Rakefile | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index a49fadf..4483a3b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,7 @@ source 'https://rubygems.org' gem 'rake', '~> 13' gem 'slim', '~> 4' gem 'sass', '~> 3' +gem 'psych', '~> 2' # optional group :markdown do diff --git a/Gemfile.lock b/Gemfile.lock index 6cd9807..d7fbfa5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,7 @@ GEM remote: https://rubygems.org/ specs: ffi (1.15.5) + psych (2.2.4) rake (13.0.6) rb-fsevent (0.11.1) rb-inotify (0.10.1) @@ -23,6 +24,7 @@ PLATFORMS ruby DEPENDENCIES + psych (~> 2) rake (~> 13) redcarpet (~> 3) rouge (~> 3) @@ -30,4 +32,4 @@ DEPENDENCIES slim (~> 4) BUNDLED WITH - 2.2.17 + 2.3.23 diff --git a/Rakefile b/Rakefile index d96d726..be01c25 100644 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,7 @@ task :style # helper libraries #----------------------------------------------------------------------------- -require 'yaml' +require 'psych' require 'time' require 'uri' @@ -294,7 +294,7 @@ end notify :load, @config_file begin - @config = YAML.load_file(@config_file).to_hash + @config = Psych.load_file(@config_file).to_hash rescue => error error.message.insert 0, "Could not load blog configuration file #{@config_file.inspect}\n" @@ -317,7 +317,7 @@ notify :load, @entry_source_files_glob entry_sources_by_output = Hash.new {|h,k| h[k] = [] } @entries = Dir[@entry_source_files_glob].map do |source_file| begin - entry = YAML.load_file(source_file) + entry = Psych.load_file(source_file) entry[:source_file] = source_file sanitized_file = sanitize_filename(source_file)