Sha256: 897f230799c64d6230b2effd795ae8de18546933d9f86a54934ae7ce9030d105
Contents?: true
Size: 618 Bytes
Versions: 14
Compression:
Stored size: 618 Bytes
Contents
module Shiba class Connection def self.build(hash) server_type = hash['server'] if !server_type port = hash['port'].to_i if port == 3306 server_type = 'mysql' elsif port == 5432 server_type = 'postgres' else raise "couldn't determine server type! please pass --server" end end if server_type == 'mysql' require 'shiba/connection/mysql' Shiba::Connection::Mysql.new(hash) else require 'shiba/connection/postgres' Shiba::Connection::Postgres.new(hash) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems