File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,13 @@ def exists?
14
14
@url && @url . size > 0
15
15
end
16
16
17
- # host can be "/var/run/postgresql,/run/postgresql,/tmp" on Linux with pg 1.6+
18
17
def local?
19
- !host || %w( localhost 127.0.0.1 ) . include? ( host ) || host . split ( "," ) . all? { |v | v . start_with? ( "/" ) }
18
+ socket? || %w( localhost 127.0.0.1 ) . include? ( host )
19
+ end
20
+
21
+ # host can be "/var/run/postgresql,/run/postgresql,/tmp" on Linux with pg 1.6+
22
+ def socket?
23
+ !host || host . split ( "," ) . all? { |v | v . start_with? ( "/" ) }
20
24
end
21
25
22
26
def host
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ def search_tree(file)
124
124
end
125
125
126
126
def print_description ( prefix , source )
127
- location = " on #{ source . host } :#{ source . port } " if source . host
127
+ location = " on #{ source . host } :#{ source . port } " if ! source . socket?
128
128
log "#{ prefix } : #{ source . dbname } #{ location } "
129
129
end
130
130
You can’t perform that action at this time.
0 commit comments