dblink 0.4.1 → 0.4.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fa1d5f8f3eb44b4a601b31f316a116eaaf9e407
4
- data.tar.gz: b77f4b10dcd7fb5fbc0e9aa31c0b15cc6060b5c4
3
+ metadata.gz: d33123b9683b534b242cd40b89464add84043041
4
+ data.tar.gz: 0f32925cd53bd6de9166f48946e0ded77f57f1d3
5
5
  SHA512:
6
- metadata.gz: f9aaf62389fb3a7c2e66bec072a97c4aab726b42496c2188af088a02f972b152720a46301af267e9d0c6f56953cebba521eb8d1d8eb2249807b78dfd5620bb4b
7
- data.tar.gz: 90a3553b0bfb14013e769b7b52ff760fe73b57a215f15c88bfcbc84ec583fb28f7a8990e3ebcc48b06b3e1cfbe309925df9110496e9d0f81921278bab5162120
6
+ metadata.gz: 9c88ec2760b432e44a777c9bab248d82aa011f94e734db78238cf1642d41ed5f435b247c0b08ea7978b6f025e00193ef06b50bba314f4ba719c5a715e38aaff2
7
+ data.tar.gz: d8815d622451edefa18aa8df78f63146afda7136ab8c85604470c0c72c6f3c38f240a7c2084ddb60d15f61164909de35ec35fa9c9e1ba649f68227cde5ec7287
data/bin/dblink CHANGED
@@ -71,6 +71,10 @@ OptionParser.new do |opts|
71
71
  CLI_OPTS[:check_tonnel] = value
72
72
  end
73
73
 
74
+ opts.on("--pgbouncer-user [USER]", "PgBouncer can not run as root") do |value|
75
+ CLI_OPTS[:pgbouncer_user] = value
76
+ end
77
+
74
78
  opts.on_tail("-h", "--help", "Show this message") do
75
79
  puts opts
76
80
  exit
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "dblink"
3
- s.version = "0.4.1"
3
+ s.version = "0.4.2"
4
4
  s.author = ["Pavel Evstigneev"]
5
5
  s.description= "CLI utility to share access to your local PostgreSQL server"
6
6
  s.email = ["pavel.evst@gmail.com"]
@@ -18,7 +18,8 @@ class PgBouncerRunner
18
18
  create_config unless @tmp_folder
19
19
 
20
20
  verbose_arg = @verbose ? '-v' : ''
21
- pgb_command = "#{pgbouncer_path} #{verbose_arg} ./config.ini"
21
+ pgb_user_arg = CLI_OPTS[:pgbouncer_user] ? "-u #{CLI_OPTS[:pgbouncer_user]}" : ""
22
+ pgb_command = "#{pgbouncer_path} #{verbose_arg} #{pgb_user_arg} ./config.ini"
22
23
 
23
24
  if @verbose
24
25
  puts "Running pgbouncer with config at: #{@tmp_folder}"
@@ -66,7 +67,7 @@ class PgBouncerRunner
66
67
  puts "Please install it"
67
68
  exit(1)
68
69
  else
69
- return path
70
+ return path.strip
70
71
  end
71
72
 
72
73
  end
@@ -40,7 +40,7 @@ module PsqlRunner
40
40
  path = 'psql'
41
41
  elsif RUBY_PLATFORM =~ /darwin/
42
42
  paths = Dir.glob('/Applications/Postgres.app/Contents/Versions/**/psql')
43
- path = paths.last if paths.size > 0
43
+ path = paths.last.strip if paths.size > 0
44
44
  end
45
45
 
46
46
  path == '' ? nil : path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dblink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Evstigneev