pgai 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pgai/cli/main.rb +10 -7
- data/lib/pgai/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 638625e64ce9fa8f81c98f8a618b74f3d9f1e7ae14632bb4994a581011ad4bf3
|
4
|
+
data.tar.gz: 4703d7e923b428ac933f72335af104b373b991d048abef7516248983d8dcfb25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f05388f1e73e3277a06baea0298bafd175a8e50959e3a0fe9580e099820e84bd13e1665c9f8841b0e46f437fea638728a11c510c332026834fa399144394b022
|
7
|
+
data.tar.gz: dd1c62be57dd6fa39a4b9b685f390072eb6e51ebb9dc7a10627c7366ddf89521e9edca73b17def3e178d36108c889466e6ca95a038cb121635092084c7ff8646
|
data/lib/pgai/cli/main.rb
CHANGED
@@ -40,14 +40,17 @@ module Pgai::Cli
|
|
40
40
|
print_table data
|
41
41
|
end
|
42
42
|
|
43
|
-
desc "
|
44
|
-
method_option :only, aliases: "-o", desc: "
|
45
|
-
def
|
43
|
+
desc "use", "Execute the given command with DATABASE_URLs"
|
44
|
+
method_option :only, aliases: "-o", desc: "Export only this database connection", repeatable: true
|
45
|
+
def use(*command)
|
46
46
|
envs = options.fetch(:only) { configuration.enviroments.keys }
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
|
48
|
+
vars = envs.each_with_object({}) do |env, acc|
|
49
|
+
environment = configuration.enviroments.fetch(env)
|
50
|
+
clone = Pgai::CloneManager.new(environment, config: configuration).clone
|
51
|
+
|
52
|
+
acc["#{env.to_s.upcase}_DATABASE_URL"] = clone.database_url
|
53
|
+
end
|
51
54
|
|
52
55
|
exec(vars, *command)
|
53
56
|
end
|
data/lib/pgai/version.rb
CHANGED