Sha256: c2568aed5ec9a9002b085447a7c7fdad61b930a3b60f0c36fcf539ed460d1877
Contents?: true
Size: 697 Bytes
Versions: 7
Compression:
Stored size: 697 Bytes
Contents
# frozen_string_literal: true require "fileutils" require "pathname" class Combustion::Databases::SQLite < Combustion::Databases::Base private def create if exists? warn "#{config["database"]} already exists" return end establish_connection configuration connection rescue StandardError => error warn error, *error.backtrace warn "Couldn't create database for #{configuration.inspect}" end def drop FileUtils.rm_f file if exists? end def exists? File.exist? file end def file @file ||= path.absolute? ? path.to_s : File.join(Rails.root, path) end def path @path ||= Pathname.new configuration["database"] end end
Version data entries
7 entries across 7 versions & 1 rubygems