lib/combustion/databases/sqlite.rb in combustion-0.7.0 vs lib/combustion/databases/sqlite.rb in combustion-0.8.0

- old
+ new

@@ -1,21 +1,23 @@ -require 'fileutils' -require 'pathname' +# frozen_string_literal: true +require "fileutils" +require "pathname" + class Combustion::Databases::SQLite < Combustion::Databases::Base private def create if exists? - $stderr.puts "#{config['database']} already exists" + $stderr.puts "#{config["database"]} already exists" return end establish_connection configuration connection - rescue Exception => error - $stderr.puts error, *(error.backtrace) + rescue StandardError => error + $stderr.puts error, *error.backtrace $stderr.puts "Couldn't create database for #{configuration.inspect}" end def drop FileUtils.rm_f file if exists? @@ -28,8 +30,8 @@ def file @file ||= path.absolute? ? path.to_s : File.join(Rails.root, path) end def path - @path ||= Pathname.new configuration['database'] + @path ||= Pathname.new configuration["database"] end end