pgbouncerhero 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 054de6f1d8d3846419f355c4512129e06385c8af
4
- data.tar.gz: 1254bddb23ead79c688f283b07e179b41a328fd9
3
+ metadata.gz: 827a3a4bfea83fcb9b95692c6401847a453a59e2
4
+ data.tar.gz: 803feac4e01686ff104e1a55cd2c176d5d366907
5
5
  SHA512:
6
- metadata.gz: cf35ed3c426b20262a6be30a555eba7547c8cd1c89db7fe200a76babe5f4842298df9b0b7eb4ce0a9b3efb555d46c392c67627f4aed826417997ff4830fe9a71
7
- data.tar.gz: fb73c61c6dda241124a59db1820083cfcf24d4cf25ae16f3c524feb7f05485d1054ec74bed889a2faad6847773603aec8d565003f4d81f8468e92de8c9374204
6
+ metadata.gz: 9d47db11b462287b0b5ba8c9f4c42c1b4bf3cd04d46b2c0d28cff8cae6b28d4546667bc10f83d2de9193cd14c11ec976a661da53da8955d3fb620b7e0dfc42ab
7
+ data.tar.gz: a096b7a22b57c9682af5a4ed4523618a616165409c6cd3416987e8dd94626c504378b7baeed0485f53be97b3fc56c939d95b88fc22679f3fcb74b191bb614f68
@@ -1,5 +1,4 @@
1
1
  require "pgbouncerhero/version"
2
- require "active_record"
3
2
 
4
3
  # methods
5
4
  require "pgbouncerhero/methods/basics"
@@ -10,18 +10,20 @@ module PgBouncerHero
10
10
  end
11
11
 
12
12
  def connection
13
- begin
14
- PG.connect(
15
- host: @host,
16
- port: @port,
17
- user: @user,
18
- password: @password,
19
- dbname: @dbname,
20
- connect_timeout: 5
21
- )
22
- rescue => e
23
- Rails.logger.info(e)
24
- nil
13
+ @connection ||= begin
14
+ begin
15
+ PG.connect(
16
+ host: @host,
17
+ port: @port,
18
+ user: @user,
19
+ password: @password,
20
+ dbname: @dbname,
21
+ connect_timeout: 5
22
+ )
23
+ rescue => e
24
+ Rails.logger.info(e)
25
+ nil
26
+ end
25
27
  end
26
28
  end
27
29
 
@@ -17,7 +17,7 @@ module PgBouncerHero
17
17
  end
18
18
 
19
19
  def connection
20
- connection_model.new(host, port, user, password, dbname).connection
20
+ @connection ||= connection_model.new(host, port, user, password, dbname).connection
21
21
  end
22
22
 
23
23
  def host
@@ -1,3 +1,3 @@
1
1
  module PgBouncerHero
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbouncerhero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quentin Rousseau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-04 00:00:00.000000000 Z
11
+ date: 2017-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.5.1
184
+ rubygems_version: 2.5.2
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: A graphical user interface for your PGBouncers