lib/canals/session.rb in canals-0.8.4 vs lib/canals/session.rb in canals-0.8.5
- old
+ new
@@ -38,9 +38,14 @@
when String
@session.find{ |s| s[:name] == session_id }
end
end
+ def alive?(session_id)
+ sess = get(session_id)
+ File.exist?(sess[:socket])
+ end
+
def save!
FileUtils.mkdir_p(session_file.dirname)
File.open(session_file, 'w') do |file|
file.write(Psych.dump(@session))
end