From 4512c333b4e844e6cfa9626b387e7a1011a47ca1 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Wed, 27 Mar 2013 18:18:57 +0900 Subject: [PATCH] MozillaStore: Add #filename, #close and #closed?. --- lib/http/cookie_jar/mozilla_store.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/http/cookie_jar/mozilla_store.rb b/lib/http/cookie_jar/mozilla_store.rb index 60871c2..694ec8a 100644 --- a/lib/http/cookie_jar/mozilla_store.rb +++ b/lib/http/cookie_jar/mozilla_store.rb @@ -63,6 +63,21 @@ class HTTP::CookieJar @gc_index = 0 end + # The file name of the SQLite3 database given in initialization. + attr_reader :filename + + # Closes the SQLite3 database. After closing, any operation may + # raise an error. + def close + @db.close + self + end + + # Tests if the SQLite3 database is closed. + def closed? + @db.closed? + end + # Returns the schema version of the database. def schema_version @schema_version ||= @db.execute("PRAGMA user_version").first[0]