]> git.cworth.org Git - sup/commitdiff
bugfix: save_yaml_object not using File.stat correctly
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 15 Apr 2008 16:14:39 +0000 (09:14 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 15 Apr 2008 16:14:39 +0000 (09:14 -0700)
lib/sup.rb

index 1946f3c56ba00ec4b3da458ae193710cf0a3f8a5..9e9026747bca29324fe44cf4b4df12c1d8e54ccc 100644 (file)
@@ -72,7 +72,7 @@ module Redwood
   def save_yaml_obj object, fn, safe=false
     if safe
       safe_fn = "#{File.dirname fn}/safe_#{File.basename fn}"
-      mode = File.stat(fn) if File.exists? fn
+      mode = File.stat(fn).mode if File.exists? fn
       File.open(safe_fn, "w", mode) { |f| f.puts object.to_yaml }
       FileUtils.mv safe_fn, fn
     else