dblink 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 456b57a2e4619b08713f7921299b7046a5750649
4
- data.tar.gz: c704b0a9743500ac4f421452ea9eae534fdde7b6
3
+ metadata.gz: 7dc7ff262789a0427e093aa5ed485ab383682e6d
4
+ data.tar.gz: 232d1c878b7b03d57f30bd726d3c624a24f5a49a
5
5
  SHA512:
6
- metadata.gz: 9d3e6b98eaf0977bea19f4c88b131c70a0655459462dc1d9bf8b6e7fc9174f2b32538f778a2088b69bb41a2af40ad0524bb4430e5db2ee119b37a51bb2f81f88
7
- data.tar.gz: 3387240003ec5445e121f69ee031d99309038c1c7413e4c8203e412e4b673ec1bb8db77b2ef9495544eeeebaa42050cf98c21a1c11f51bbd2066e46ac7b2062e
6
+ metadata.gz: bffd616f17c6634c0aa1dfb2a3471dd487943d153eee3ff0306b4f692d62f83df6918dce51a1b4b28033c31d4521e06fe225310cd49385c5d8ae1fa1d24c6f70
7
+ data.tar.gz: 34d3a73e5acc825b6c0a971122dffdca4f82f7e9e825e9234d15ff85f607ec061472b8526886ea484f782eca1ba06676d7611df2e0b9088188a673b2c4564d19
data/bin/dblink CHANGED
@@ -27,6 +27,7 @@ CLI_OPTS = {
27
27
  port: 5432,
28
28
  user: ENV['USER'],
29
29
  database: ENV['USER'],
30
+ public: false,
30
31
  check_local: true,
31
32
  check_tonnel: true
32
33
  }
@@ -58,6 +59,10 @@ OptionParser.new do |opts|
58
59
  CLI_OPTS[:password] = value
59
60
  end
60
61
 
62
+ opts.on("--public", "Default false. Add it to public catalog") do |value|
63
+ CLI_OPTS[:public] = value
64
+ end
65
+
61
66
  opts.on("-cl", "--[no-]check-local", "Default true. Check connection to local PostgreSQL server") do |value|
62
67
  CLI_OPTS[:check_local] = value
63
68
  end
@@ -174,7 +179,7 @@ end
174
179
  db_url = pgb_runner.make_db_url(tonnel.remote_port)
175
180
 
176
181
  puts
177
- puts "DATABSE CONNECTION:"
182
+ puts "DATABSE URL:"
178
183
  puts " #{db_url}"
179
184
  puts
180
185
 
@@ -186,7 +191,7 @@ if psql_path
186
191
  puts
187
192
  end
188
193
 
189
- web_response = WebService.register_link(db_url, verbose: CLI_OPTS[:verbose])
194
+ web_response = WebService.register_link(db_url, is_public: CLI_OPTS[:public], verbose: CLI_OPTS[:verbose])
190
195
 
191
196
  if web_response['status'] == 'success'
192
197
  puts "WEB URL:"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "dblink"
3
- s.version = "0.3"
3
+ s.version = "0.4"
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"]
@@ -1,10 +1,10 @@
1
1
  module WebService
2
2
  extend self
3
3
 
4
- #SERVICE_URL = "http://localhost:3000/dblinks"
5
- SERVICE_URL = "http://dblink.r15.railsrumble.com/dblinks"
4
+ SERVICE_URL = "http://localhost:3000/dblinks"
5
+ #SERVICE_URL = "http://dblink.r15.railsrumble.com/dblinks"
6
6
 
7
- def register_link(database_url, verbose: false)
7
+ def register_link(database_url, is_public: false, verbose: false)
8
8
  require 'uri'
9
9
  require 'net/http'
10
10
 
@@ -13,7 +13,8 @@ module WebService
13
13
  request = Net::HTTP::Post.new(uri.path)
14
14
 
15
15
  params = {
16
- database_url: database_url
16
+ database_url: database_url,
17
+ is_public: is_public
17
18
  }
18
19
 
19
20
  if verbose
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.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Evstigneev