dblink 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dblink +7 -2
- data/dblink.gemspec +1 -1
- data/lib/dblink/web_service.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dc7ff262789a0427e093aa5ed485ab383682e6d
|
4
|
+
data.tar.gz: 232d1c878b7b03d57f30bd726d3c624a24f5a49a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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:"
|
data/dblink.gemspec
CHANGED
data/lib/dblink/web_service.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module WebService
|
2
2
|
extend self
|
3
3
|
|
4
|
-
|
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
|