ruby-pg-extras 3.2.5 → 3.3.0

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: 215a0cc7419021dbe7a9d0a62ec22707110338b891d4b822de03a5040391180c
4
- data.tar.gz: 3bda8bea49fc3e05c96e45652a4d35036cc675c3e4e245febbcbc1198e4e90d2
3
+ metadata.gz: 24b2658f1f03b3d3251ec09c992a3622b30793ef64caf92f51baaa8558c792f9
4
+ data.tar.gz: d9b716c71c8bb2cf230b61132b91df5537f543857a0dbf4d37679b9805e2d1ed
5
5
  SHA512:
6
- metadata.gz: 3e8fe8accc5518cfa61fa5f4f80aee4272d392d7e31f8c63e0e979c2e046537a12ccb658f89a360d50aa8e155d5369de44fa3f8c0e9b202f9cdf6a34df23d82b
7
- data.tar.gz: 550f63e042809b83777baf3dcbaec7e36800017e5d22376dbbab1a512a903c31f5eb7f72efe4d6ca413aee18acb72ed11ab7c3ebf7e50f26cea8aa52fb45032d
6
+ metadata.gz: 8a4478c18db57ce31dd34faa8c998aef38bd18b85c758312656e2d24604cd89f12e6978b754aac9045b1273705f71813e51401a930dadc50ad3c3c081dd5df83
7
+ data.tar.gz: 0e3ad8983b6ce98b0dad4db84b444040b2060e268395ec67d322a2d8fee8043f3996da03f7a20b90945180e939078bafeae7d30a2d45fec8d42a19ce5ebb05b7
data/README.md CHANGED
@@ -139,7 +139,7 @@ RubyPGExtras.index_info(args: { table_name: "users" })
139
139
  | index_users_on_slack_id | users | slack_id | 1080 kB | 258870 | 0.00% |
140
140
  | index_users_on_team_id | users | team_id | 816 kB | 70962 | 0.00% |
141
141
  | index_users_on_uuid | users | uuid | 1032 kB | 0 | 0.00% |
142
- | index_users_on_block_uuid | users | block_uuid | 776 kB | 19502 | 100.00% |
142
+ | index_users_on_block_uuid | users | block_uuid | 776 kB | 19502 | 100.00% |
143
143
  | index_users_on_api_auth_token | users | api_auth_token | 1744 kB | 156 | 0.00% |
144
144
 
145
145
  ```
@@ -118,7 +118,7 @@ module RubyPGExtras
118
118
  in_format: :hash,
119
119
  args: { min_scans: PG_EXTRAS_UNUSED_INDEXES_MAX_SCANS }
120
120
  ).select do |i|
121
- Filesize.from(i.fetch("index_size")).to_i >= PG_EXTRAS_UNUSED_INDEXES_MIN_SIZE_BYTES
121
+ Filesize.from(i.fetch("index_size").sub("bytes", "").strip).to_i >= PG_EXTRAS_UNUSED_INDEXES_MIN_SIZE_BYTES
122
122
  end
123
123
 
124
124
  if indexes.count == 0
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyPGExtras
4
- VERSION = "3.2.5"
4
+ VERSION = "3.3.0"
5
5
  end
@@ -159,15 +159,7 @@ module RubyPGExtras
159
159
  end
160
160
 
161
161
  def self.connection
162
- database_uri = URI.parse(database_url)
163
-
164
- @_connection ||= PG.connect(
165
- dbname: database_uri.path[1..-1],
166
- host: database_uri.host,
167
- port: database_uri.port,
168
- user: database_uri.user,
169
- password: database_uri.password
170
- )
162
+ @_connection ||= PG.connect(database_url)
171
163
  end
172
164
 
173
165
  def self.database_url=(value)
@@ -3,21 +3,25 @@ lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'ruby-pg-extras/version'
5
5
 
6
- Gem::Specification.new do |gem|
7
- gem.name = "ruby-pg-extras"
8
- gem.version = RubyPGExtras::VERSION
9
- gem.authors = ["pawurb"]
10
- gem.email = ["contact@pawelurbanek.com"]
11
- gem.summary = %q{ Ruby PostgreSQL performance database insights }
12
- gem.description = %q{ Ruby port of Heroku PG Extras. The goal of this project is to provide a powerful insights into PostgreSQL database for Ruby on Rails apps that are not using the default Heroku PostgreSQL plugin. }
13
- gem.homepage = "http://github.com/pawurb/ruby-pg-extras"
14
- gem.files = `git ls-files`.split("\n")
15
- gem.test_files = gem.files.grep(%r{^(spec)/})
16
- gem.require_paths = ["lib"]
17
- gem.license = "MIT"
18
- gem.add_dependency "pg"
19
- gem.add_dependency "filesize"
20
- gem.add_dependency "terminal-table"
21
- gem.add_development_dependency "rake"
22
- gem.add_development_dependency "rspec"
6
+ Gem::Specification.new do |s|
7
+ s.name = "ruby-pg-extras"
8
+ s.version = RubyPGExtras::VERSION
9
+ s.authors = ["pawurb"]
10
+ s.email = ["contact@pawelurbanek.com"]
11
+ s.summary = %q{ Ruby PostgreSQL performance database insights }
12
+ s.description = %q{ Ruby port of Heroku PG Extras. The goal of this project is to provide a powerful insights into PostgreSQL database for Ruby on Rails apps that are not using the default Heroku PostgreSQL plugin. }
13
+ s.homepage = "http://github.com/pawurb/ruby-pg-extras"
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = s.files.grep(%r{^(spec)/})
16
+ s.require_paths = ["lib"]
17
+ s.license = "MIT"
18
+ s.add_dependency "pg"
19
+ s.add_dependency "filesize"
20
+ s.add_dependency "terminal-table"
21
+ s.add_development_dependency "rake"
22
+ s.add_development_dependency "rspec"
23
+
24
+ if s.respond_to?(:metadata=)
25
+ s.metadata = { "rubygems_mfa_required" => "true" }
26
+ end
23
27
  end
@@ -13,7 +13,7 @@ describe RubyPGExtras::DiagnoseData do
13
13
  expect(RubyPGExtras).to receive(:unused_indexes) {
14
14
  [
15
15
  { "table" => "public.plans", "index" => "index_plans_on_payer_id", "index_size" => "16 MB", "index_scans" => 0 },
16
- { "table" => "public.feedbacks", "index" => "index_feedbacks_on_target_id", "index_size" => "80 kB", "index_scans" => 1 },
16
+ { "table" => "public.feedbacks", "index" => "index_feedbacks_on_target_id", "index_size" => "111180 bytes", "index_scans" => 1 },
17
17
  { "table" => "public.channels", "index" => "index_channels_on_slack_id", "index_size" => "56 MB", "index_scans" => 7}
18
18
  ]
19
19
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-pg-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.5
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-21 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -152,8 +152,9 @@ files:
152
152
  homepage: http://github.com/pawurb/ruby-pg-extras
153
153
  licenses:
154
154
  - MIT
155
- metadata: {}
156
- post_install_message:
155
+ metadata:
156
+ rubygems_mfa_required: 'true'
157
+ post_install_message:
157
158
  rdoc_options: []
158
159
  require_paths:
159
160
  - lib
@@ -169,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
170
  version: '0'
170
171
  requirements: []
171
172
  rubygems_version: 3.1.6
172
- signing_key:
173
+ signing_key:
173
174
  specification_version: 4
174
175
  summary: Ruby PostgreSQL performance database insights
175
176
  test_files: