Sha256: dd4db90499333b54d04fc1871c93b5540a83f6d0cfcb2da3863daf43faa7f7ef

Contents?: true

Size: 444 Bytes

Versions: 7

Compression:

Stored size: 444 Bytes

Contents

require 'mysql2'

module Caramelize
  module DatabaseConnector
  
    def database
      socket = ["/tmp/mysqld.sock", 
      "/tmp/mysql.sock", 
      "/var/run/mysqld/mysqld.sock",
      "/opt/local/var/run/mysql5/mysqld.sock",
      "/var/lib/mysql/mysql.sock"].detect{|socket| File.exist?(socket)  }
      @options[:socket] = socket
      @client = Mysql2::Client.new(@options) unless @client
      @client
      
    end
    
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
caramelize-0.2.0 lib/caramelize/database_connector.rb
caramelize-0.1.2 lib/caramelize/database_connector.rb
caramelize-0.1.1 lib/caramelize/database_connector.rb
caramelize-0.1.0 lib/caramelize/database_connector.rb
caramelize-0.0.3 lib/caramelize/database_connector.rb
caramelize-0.0.2 lib/caramelize/database_connector.rb
caramelize-0.0.1 lib/caramelize/database_connector.rb