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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16b287abec3a2748a73207afe42f679c03055a989496ba5610bcae530f565352
4
- data.tar.gz: c2414c821b4fbf99fe12e7d8031c40cc17aa437a33a68d0a4ecdb8c2586418fd
3
+ metadata.gz: 638625e64ce9fa8f81c98f8a618b74f3d9f1e7ae14632bb4994a581011ad4bf3
4
+ data.tar.gz: 4703d7e923b428ac933f72335af104b373b991d048abef7516248983d8dcfb25
5
5
  SHA512:
6
- metadata.gz: d113076e6e8568cea4bbf34a9c6e2101c0375063e9458baafd87a2510ef2ff79f912d082adeec6abfdd0177dcf349fec59b76c0c2544d933522b437a1fca370a
7
- data.tar.gz: cbe551ec80fe9a53b47f8d99789fd603bf01d5b4217f34d6df1eded1a2ae6005cad94006ddcba52b00acea28be5b841eca71db32f4eca724e59bc3f9374e62f4
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 "exp", "Show clone details"
44
- method_option :only, aliases: "-o", desc: "Configure only this variable", repeatable: true
45
- def exp(*command)
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
- clones = envs.each_with_object({}) { |env, acc|
48
- acc[env] = Pgai::CloneManager.new(configuration.enviroments.fetch(env), config: configuration).clone
49
- }
50
- vars = clones.map { |env, clone| ["#{env.to_s.upcase}_DATABASE_URL", clone.database_url] }.to_h
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
@@ -1,3 +1,3 @@
1
1
  module Pgai
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marius Bobin