Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* default uri on windows is tcp://localhost:5432

* new release 0.2.1
  • Loading branch information...
commit a10a89bd61341cd3578a59ff36febd24093560e8 1 parent 5289dde
@mneumann mneumann authored
Showing with 10 additions and 3 deletions.
  1. +9 −2 lib/postgres-pr/connection.rb
  2. +1 −1  postgres-pr.gemspec
View
11 lib/postgres-pr/connection.rb
@@ -8,14 +8,14 @@
require 'socket'
require 'thread'
-PROTO_VERSION = 196608
+PROTO_VERSION = 3 << 16 #196608
class Connection
# sync
def initialize(database, user, password=nil, uri = nil)
- uri ||= "unix:/tmp/.s.PGSQL.5432"
+ uri ||= DEFAULT_URI
raise unless @mutex.nil?
@@ -116,6 +116,13 @@ def query(sql)
DEFAULT_PORT = 5432
DEFAULT_HOST = 'localhost'
+ DEFAULT_PATH = '/tmp'
+ DEFAULT_URI =
+ if RUBY_PLATFORM.include?('win')
+ 'tcp://' + DEFAULT_HOST + ':' + DEFAULT_PORT.to_s
+ else
+ 'unix:' + File.join(DEFAULT_PATH, '.s.PGSQL.' + DEFAULT_PORT.to_s)
+ end
private
View
2  postgres-pr.gemspec
@@ -2,7 +2,7 @@ require 'rubygems'
spec = Gem::Specification.new do |s|
s.name = 'postgres-pr'
- s.version = '0.2.0'
+ s.version = '0.2.1'
s.summary = 'A pure Ruby interface to the PostgreSQL database'
s.files = (Dir['lib/**/*'] + Dir['test/**/*'] +
Please sign in to comment.
Something went wrong with that request. Please try again.