OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / script / preup.rb
index cc55dcc..c902cb4 100644 (file)
@@ -32,14 +32,14 @@ Dir.glob(dirname + '/*') do |fn|
         puts 'get attributes.json'\r
         attr = nil\r
         File.open(attrfn, 'r') do |f|\r
-          attr = f.read\r
+          attr = JSON.parse(f.read)\r
         end\r
         json = JSON.parse(open(ls).read)\r
         if json['attributes'] and attr\r
           json['attributes'] = attr\r
         end\r
         File.open(lsfn, 'w') do |f|\r
-          f.write json.to_json.to_s\r
+          f.write JSON.pretty_generate(json)\r
         end\r
       else\r
         FileUtils.cp ls, lsfn\r