whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Safety first
Date Mon, 01 Jun 2020 19:06:16 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 8216791  Safety first
8216791 is described below

commit 8216791d251ae5ae604f7c0c9c18f971e65b5935
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Jun 1 20:06:02 2020 +0100

    Safety first
---
 lib/whimsy/asf/yaml.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/whimsy/asf/yaml.rb b/lib/whimsy/asf/yaml.rb
index 143a3d6..a117626 100644
--- a/lib/whimsy/asf/yaml.rb
+++ b/lib/whimsy/asf/yaml.rb
@@ -16,7 +16,7 @@ module YamlFile
   def self.update(yaml_file)
     File.open(yaml_file, File::RDWR|File::CREAT, 0644) do |file| 
       file.flock(File::LOCK_EX)
-      yaml = YAML.load(file.read) || {} rescue {}
+      yaml = YAML.safe_load(file.read) || {} rescue {}
       yield yaml
       file.rewind
       file.write YAML.dump(yaml)
@@ -32,7 +32,7 @@ module YamlFile
   def self.read(yaml_file)
     File.open(yaml_file, File::RDONLY) do |file|
       file.flock(File::LOCK_SH)
-      yaml = YAML.load(file.read) || {} rescue {}
+      yaml = YAML.safe_load(file.read) || {} rescue {}
       if block_given?
         yield yaml
       else


Mime
View raw message