From a2496f647ff0f2532fb8ee4a0c02c80e7aa2a2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 13 May 2012 00:46:31 +0200 Subject: Spin: a few hibernate related adjustments --- lib/evendoors/spin.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/evendoors/spin.rb b/lib/evendoors/spin.rb index 88af3bc..a5795b7 100644 --- a/lib/evendoors/spin.rb +++ b/lib/evendoors/spin.rb @@ -48,7 +48,7 @@ module EvenDoors end end # - attr_accessor :run, :debug_errors, :debug_routing + attr_accessor :run, :hibernate_path, :debug_errors, :debug_routing # def to_json *a { @@ -103,6 +103,7 @@ module EvenDoors # def process_sys_p p if p.action==EvenDoors::SYS_ACT_HIBERNATE + stop! hibernate! p[FIELD_HIBERNATE_PATH] else super p @@ -131,12 +132,11 @@ module EvenDoors end # def hibernate! path=nil - stop! File.open(path||@hibernate_path,'w') do |f| f << JSON.pretty_generate(self) end end # - def self.resume! path=nil - self.json_create JSON.load File.open(path||@hibernate_path,'r') { |f| f.read } + def self.resume! path + self.json_create JSON.load File.open(path,'r') { |f| f.read } end # end -- cgit v1.1-2-g2b99