pgtk 0.30.1 → 0.30.2
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/pgtk/version.rb +1 -1
- data/lib/pgtk/wire.rb +3 -4
- 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: de43fbda1aae86b87391fb1666ea26dee73ad5879dd638c63ecef16e66db2c32
|
|
4
|
+
data.tar.gz: bfa2d9e967e0fe67612970f99501ec5fe11b7d5c23f0c20c1bd3a932335a97e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff7fd4b8c06199802b2294da75ae651195564f3dcd5f394244c4a4f458e1f74813d3376862f4aace321042b5230c86b088690cde4536d8922fa9f67236f36e40
|
|
7
|
+
data.tar.gz: 7599796007c2512f21fd2edbad3fda7ab875747870b22d7589188b5fd39ae916392bf8af8a7589235d179c56d7cdbf3764f4386174f54d8304976fd72c1d8de6
|
data/lib/pgtk/version.rb
CHANGED
data/lib/pgtk/wire.rb
CHANGED
|
@@ -61,14 +61,13 @@ class Pgtk::Wire::Env
|
|
|
61
61
|
# @param [String] var The name of the environment variable with the connection URL
|
|
62
62
|
def initialize(var = 'DATABASE_URL')
|
|
63
63
|
raise "The name of the environment variable can't be nil" if var.nil?
|
|
64
|
-
@
|
|
64
|
+
@value = ENV.fetch(var, nil)
|
|
65
|
+
raise "The environment variable #{@value.inspect} is not set" if @value.nil?
|
|
65
66
|
end
|
|
66
67
|
|
|
67
68
|
# Create a new connection to PostgreSQL server.
|
|
68
69
|
def connection
|
|
69
|
-
|
|
70
|
-
raise "The environment variable #{@var.inspect} is not set" if v.nil?
|
|
71
|
-
uri = URI(v)
|
|
70
|
+
uri = URI(@value)
|
|
72
71
|
Pgtk::Wire::Direct.new(
|
|
73
72
|
host: CGI.unescape(uri.host),
|
|
74
73
|
port: uri.port,
|