heroku_cli 0.2.3 → 0.2.5
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 +4 -4
- data/lib/heroku_cli/pg/database.rb +10 -1
- data/lib/heroku_cli/pg.rb +24 -0
- data/lib/heroku_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d7ce92b81357a8a4268f9f4991c1873b4ab3fdd92ff741d539b0ab577b13ec3
|
4
|
+
data.tar.gz: 22693cdde72f5c2211fe65556123b3a4550ab596ee0d8b88221118a6fb1b807a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64e62b26b02d93544f11bc6242987431ce9aa766d07e1b5784e8ee5047f6f9e4001a2df85ecbe29bbc0465e08f206294f4943ebc8bbf0146cc476d7df0862139
|
7
|
+
data.tar.gz: e9213e1490782409bc182de28a0afab4f3a59e7906cf0b4603c1c16180a8df905ab3b7593667d11520a143e076f1a92ae591695b1b19c88dcb7d235e14b8888c
|
@@ -11,7 +11,7 @@ module HerokuCLI
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def reload
|
14
|
-
parse_info(pg.heroku("pg:info #{url_name}"))
|
14
|
+
parse_info(pg.heroku("pg:info #{url_name}")) unless pg.nil?
|
15
15
|
end
|
16
16
|
|
17
17
|
def url_name
|
@@ -38,6 +38,11 @@ module HerokuCLI
|
|
38
38
|
info['Data Size']
|
39
39
|
end
|
40
40
|
|
41
|
+
def created
|
42
|
+
info['Created']
|
43
|
+
end
|
44
|
+
|
45
|
+
|
41
46
|
def status
|
42
47
|
info['Status']
|
43
48
|
end
|
@@ -78,6 +83,10 @@ module HerokuCLI
|
|
78
83
|
info.key?('Following')
|
79
84
|
end
|
80
85
|
|
86
|
+
def available?
|
87
|
+
status == 'Available'
|
88
|
+
end
|
89
|
+
|
81
90
|
def behind?
|
82
91
|
behind_by.positive?
|
83
92
|
end
|
data/lib/heroku_cli/pg.rb
CHANGED
@@ -19,6 +19,12 @@ module HerokuCLI
|
|
19
19
|
@info = nil
|
20
20
|
end
|
21
21
|
|
22
|
+
# Create a fork database
|
23
|
+
def create_fork(database, options = {})
|
24
|
+
plan = options.delete(:plan) || database.plan
|
25
|
+
heroku "addons:create heroku-postgresql:#{plan}", "--fork #{database.resource_name}"
|
26
|
+
end
|
27
|
+
|
22
28
|
# create a follower database
|
23
29
|
def create_follower(database, options = {})
|
24
30
|
plan = options.delete(:plan) || database.plan
|
@@ -41,6 +47,12 @@ module HerokuCLI
|
|
41
47
|
heroku "pg:promote #{database.resource_name}"
|
42
48
|
end
|
43
49
|
|
50
|
+
# Get a remote connection url for a database
|
51
|
+
def connection_url(database)
|
52
|
+
url_name = database.url_name
|
53
|
+
(heroku "config:get #{url_name}").strip
|
54
|
+
end
|
55
|
+
|
44
56
|
def destroy(database)
|
45
57
|
raise "Cannot destroy #{application.name} main database" if database.main?
|
46
58
|
heroku "addons:destroy #{database.url_name} -c #{application.name}"
|
@@ -66,6 +78,18 @@ module HerokuCLI
|
|
66
78
|
heroku 'pg:wait'
|
67
79
|
end
|
68
80
|
|
81
|
+
# blocks until database is available but waits until pg:info actually says it is ready
|
82
|
+
def wait_for(database, wait_time = 10)
|
83
|
+
until database.available?
|
84
|
+
puts "...wait #{wait_time} seconds for DB to change status to available"
|
85
|
+
sleep wait_time
|
86
|
+
database.reload
|
87
|
+
puts database
|
88
|
+
end
|
89
|
+
|
90
|
+
puts 'Database available!'
|
91
|
+
end
|
92
|
+
|
69
93
|
def wait_for_follow_fork_transformation(database)
|
70
94
|
while database.follower? do
|
71
95
|
puts "...wait 10 seconds for DB to change from follower to fork"
|
data/lib/heroku_cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rasmus Bergholdt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|