pgai 0.1.6 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ec24e1bc611522aea3c490acbb0f94b02085584544c979cd56ae9a3bd45f61b
4
- data.tar.gz: 7351d32aa09341ec0081e0d4c45466d83034d1ec3ec776b74bef7e05c455997e
3
+ metadata.gz: 03fa1355e1b4ddb4b4377cc88c8a402085c525693719c36a92cc61b76b0c1738
4
+ data.tar.gz: fcf92ab74e0a897fd8b0d59ef06cc71963946f648e33462b2f1835f1afd118a2
5
5
  SHA512:
6
- metadata.gz: 82761cb5d303b13edc9a8b9541e11a9c5d2c06b3765879ede4d6cf4176a8d11f1bcd24563da88481ff6648b308f265f8cc0a2b56eb01ac2cd5888417ab485062
7
- data.tar.gz: 527e1976b374a68409c6ca8591b6ab6cb043ed374f69a3daa87d76116bed7d0d04d518d00d6df38bf1305965f9db71cdf4e8aac9c2e4e01fa9a31aa7a00723be
6
+ metadata.gz: 406edf0028a55c3ee1f86bc4e8702bdac35af844fde8aa6401897ce9f5475296b80255a59f16c4fbf6ceb59d1fdcd0c3c361bb05ed5323bc762e61c94032965d
7
+ data.tar.gz: 6d4cbaeecbdea0c3354dd83973192450cdca24e4b7ffa4a3b07d699efa2b8c9fd341c0c025eed1b689821c734b2cd85ba0f05f2aa2d40d9f28768afe8a2f2017
data/lib/pgai/cli/main.rb CHANGED
@@ -2,7 +2,7 @@ module Pgai::Cli
2
2
  class Main < Base
3
3
  desc "config", "Configure CLI options"
4
4
  method_option :prefix, aliases: "-p", desc: "Specify prefix name to be used for clones", required: true
5
- method_option :dbname, aliases: "-n", desc: "Specify database name to connect to by default", required: true
5
+ method_option :dbname, aliases: "-n", desc: "Specify database name to connect to by default", required: true, default: "postgres"
6
6
  method_option :proxy, aliases: "-x", desc: "Specify proxy host name", required: true
7
7
  method_option :exe, aliases: "-e", desc: "dblab binary path"
8
8
  def config
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'securerandom'
3
+ require "securerandom"
4
4
 
5
5
  module Pgai
6
6
  class CloneManager
@@ -76,7 +76,7 @@ module Pgai
76
76
  exec("psql #{clone.connection_string}")
77
77
  end
78
78
 
79
- Signal.trap("INT") { }
79
+ Signal.trap("INT") {}
80
80
  start_caffeinate(psql_pid)
81
81
  Process.wait(psql_pid)
82
82
  ensure
data/lib/pgai/dblab.rb CHANGED
@@ -18,7 +18,7 @@ module Pgai
18
18
  end
19
19
 
20
20
  def configure_env(port:, token:, id:)
21
- dblab("init", "--url", "http://#{hostname}:#{port}", "--token", token, "--environment-id", id, silence: true)
21
+ dblab("init", "--url", "http://#{hostname}:#{port}", "--token", token, "--environment-id", id, silence: true, raw: true)
22
22
  dblab("config", "switch", id, raw: true)
23
23
  end
24
24
 
@@ -62,8 +62,7 @@ module Pgai
62
62
  end
63
63
 
64
64
  def download_dblab_to(location)
65
- platform = Gem::Platform.local
66
- uri = URI(DBLAB_BINARY_URL % {os: platform.os, cpu: platform.cpu})
65
+ uri = URI(DBLAB_BINARY_URL % {os: platform.os, cpu: cpu_platform})
67
66
 
68
67
  Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
69
68
  http.request Net::HTTP::Get.new(uri) do |response|
@@ -74,5 +73,15 @@ module Pgai
74
73
  end
75
74
  end
76
75
  end
76
+
77
+ def platform
78
+ Gem::Platform.local
79
+ end
80
+
81
+ def cpu_platform
82
+ cpu = platform.cpu
83
+ return "arm64" if cpu == "aarch64"
84
+ cpu
85
+ end
77
86
  end
78
87
  end
data/lib/pgai/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pgai
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.8"
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.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marius Bobin