lib/picky/backends/sqlite/basic.rb in picky-4.12.8 vs lib/picky/backends/sqlite/basic.rb in picky-4.12.10
- old
+ new
@@ -16,15 +16,15 @@
@initial = options[:initial]
@realtime = options[:realtime]
lazily_initialize_client
- # Note: If on OSX, too many files get opened during
- # the specs -> ulimit -n 3000
- #
- # rescue SQLite3::CantOpenException => e
- #
+ # Note: If on OSX, too many files get opened during
+ # the specs -> ulimit -n 3000
+ #
+ # rescue SQLite3::CantOpenException => e
+ #
end
def initial
@initial && @initial.clone || (@realtime ? self.reset : {})
end
@@ -43,13 +43,15 @@
end
def clear
db.execute 'delete from key_value'
end
-
+
+ # TODO Replace with db method?
+ #
def lazily_initialize_client
- @db ||= SQLite3::Database.new cache_path
+ @db ||= (create_directory cache_path; SQLite3::Database.new cache_path)
end
def dump_sqlite internal
reset
@@ -63,9 +65,11 @@
end
end
end
def reset
+ # TODO Still necessary?
+ #
create_directory cache_path
lazily_initialize_client
truncate_db