]> git.draconx.ca Git - homepage.git/commitdiff
weblog-update: Work around breakage in new ruby versions.
authorNick Bowler <nbowler@draconx.ca>
Tue, 9 Apr 2024 04:45:10 +0000 (00:45 -0400)
committerNick Bowler <nbowler@draconx.ca>
Tue, 9 Apr 2024 04:46:20 +0000 (00:46 -0400)
Apparently we now have to supply a whitelist of permitted classes
to the load method.

tools/weblog-update.rb

index f955f245d9ff3a4f861ea292f2922df40fd33ae7..677f3678166223e1921a0655cf72ba8429dc9b09 100755 (executable)
@@ -29,7 +29,7 @@ if content =~ /\A---(--)?\s*$/
 end
 
 if metadata
-    meta = YAML.load(metadata)
+    meta = YAML.load(metadata, permitted_classes: [Time])
     timefmt = "%FT%T%z"
     updatestr = updatetime.round.strftime(timefmt)
     autoset = nil
@@ -49,7 +49,7 @@ if metadata
 
     if autoset
         # Revalidate YAML
-        meta = YAML.load(metadata)
+        meta = YAML.load(metadata, permitted_classes: [Time])
         unless meta[autoset] == updatetime.round
             raise "failed to auto-insert " + autoset
         end