Skip to content

Commit

Permalink
downgrade Psych for DisallowedClass errors on Time
Browse files Browse the repository at this point in the history
  $ bundle exec rake
  Psych::DisallowedClass: Could not load blog entry file "content/*.readably"
  Tried to load unspecified class: Time

See also ruby/psych#362
  • Loading branch information
sunaku committed Oct 7, 2022
1 parent 30a96b9 commit 58da007
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source 'https://rubygems.org'
gem 'rake', '~> 13'
gem 'slim', '~> 4'
gem 'sass', '~> 3'
gem 'psych', '~> 2'

# optional
group :markdown do
Expand Down
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -23,11 +24,12 @@ PLATFORMS
ruby

DEPENDENCIES
psych (~> 2)
rake (~> 13)
redcarpet (~> 3)
rouge (~> 3)
sass (~> 3)
slim (~> 4)

BUNDLED WITH
2.2.17
2.3.23
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ task :style
# helper libraries
#-----------------------------------------------------------------------------

require 'yaml'
require 'psych'
require 'time'
require 'uri'

Expand Down Expand Up @@ -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"
Expand All @@ -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)
Expand Down

0 comments on commit 58da007

Please sign in to comment.