postgres-pr 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/postgres-pr/connection.rb +9 -2
- metadata +5 -5
@@ -8,14 +8,14 @@ require 'uri'
|
|
8
8
|
require 'socket'
|
9
9
|
require 'thread'
|
10
10
|
|
11
|
-
PROTO_VERSION = 196608
|
11
|
+
PROTO_VERSION = 3 << 16 #196608
|
12
12
|
|
13
13
|
class Connection
|
14
14
|
|
15
15
|
# sync
|
16
16
|
|
17
17
|
def initialize(database, user, password=nil, uri = nil)
|
18
|
-
uri ||=
|
18
|
+
uri ||= DEFAULT_URI
|
19
19
|
|
20
20
|
raise unless @mutex.nil?
|
21
21
|
|
@@ -116,6 +116,13 @@ class Connection
|
|
116
116
|
|
117
117
|
DEFAULT_PORT = 5432
|
118
118
|
DEFAULT_HOST = 'localhost'
|
119
|
+
DEFAULT_PATH = '/tmp'
|
120
|
+
DEFAULT_URI =
|
121
|
+
if RUBY_PLATFORM.include?('win')
|
122
|
+
'tcp://' + DEFAULT_HOST + ':' + DEFAULT_PORT.to_s
|
123
|
+
else
|
124
|
+
'unix:' + File.join(DEFAULT_PATH, '.s.PGSQL.' + DEFAULT_PORT.to_s)
|
125
|
+
end
|
119
126
|
|
120
127
|
private
|
121
128
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.1
|
|
3
3
|
specification_version: 1
|
4
4
|
name: postgres-pr
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2004-11-
|
6
|
+
version: 0.2.1
|
7
|
+
date: 2004-11-22
|
8
8
|
summary: A pure Ruby interface to the PostgreSQL database
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -26,14 +26,14 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
26
26
|
version:
|
27
27
|
platform: ruby
|
28
28
|
files:
|
29
|
-
- lib/postgres-pr
|
30
29
|
- lib/binary_writer.rb
|
31
30
|
- lib/byteorder.rb
|
31
|
+
- lib/postgres-pr
|
32
32
|
- lib/binary_reader.rb
|
33
33
|
- lib/postgres.rb
|
34
34
|
- lib/buffer.rb
|
35
|
-
- lib/postgres-pr/typeconv
|
36
35
|
- lib/postgres-pr/connection.rb
|
36
|
+
- lib/postgres-pr/typeconv
|
37
37
|
- lib/postgres-pr/message.rb
|
38
38
|
- lib/postgres-pr/typeconv/array.rb
|
39
39
|
- lib/postgres-pr/typeconv/bytea.rb
|
@@ -41,8 +41,8 @@ files:
|
|
41
41
|
- lib/postgres-pr/typeconv/TC_conv.rb
|
42
42
|
- test/TC_message.rb
|
43
43
|
- examples/client.rb
|
44
|
-
- examples/server.rb
|
45
44
|
- examples/test_connection.rb
|
45
|
+
- examples/server.rb
|
46
46
|
test_files: []
|
47
47
|
rdoc_options: []
|
48
48
|
extra_rdoc_files: []
|