rails-pg-extras 0.5.1 → 0.5.2

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: a49e217c0bc41bfafdb1d9c39fe795085934d9186b12ce278bc32d4d5f554480
4
- data.tar.gz: fc3918cbd8381edd923ead99d16f75dfa8fd6421821e8aea0bb894d85bba0071
3
+ metadata.gz: cc8fd2765b1470aa6c7f8786b0f2cbe89ae543dfe02339091d5d4d3af8decb82
4
+ data.tar.gz: c0d29ac67ae447bb91e75bd48a87a7d148cc6da05ab9430dd5b138be5d598a0f
5
5
  SHA512:
6
- metadata.gz: 4f22c9c93e980c784a5512d1ad1b0ceaeed2655f98ba3d6294377c2743fec8e751de089d06dfb488454ab97970ee1c5e7879bd065fa6cba0ae0e28ae7f628542
7
- data.tar.gz: d99d0b10ae027d25dd877ae5cab92d9cf849add1c84dc9687cde5a5c3ebc92536a8ab466e9ff2cd5ec7f2672a73dd91c245232528375819102c606e2836215e3
6
+ metadata.gz: 1a958d2044dd13b23daf446f7e776fc735800e5a7b7efcf90f52ec178c203c6442e920e3c97c41c82d34940835fa6de006e7de5be62838cad1842457adc60510
7
+ data.tar.gz: b9f9d733cd3d292fe5282785458d46a40a051a76feb5504bd59f7d138844f091997635258c76cf08e561ffae47be80b3e68669db177a5be75c94f77583b53ac2
@@ -0,0 +1,29 @@
1
+ version: 2
2
+ jobs:
3
+ test:
4
+ docker:
5
+ - image: circleci/ruby:2.6.5
6
+ environment:
7
+ DATABASE_URL: postgresql://postgres:secret@localhost:5432/rails-pg-extras-test
8
+ - image: circleci/postgres:11.5
9
+ environment:
10
+ POSTGRES_USER: postgres
11
+ POSTGRES_DB: rails-pg-extras-test
12
+ POSTGRES_PASSWORD: secret
13
+ parallelism: 1
14
+ steps:
15
+ - checkout
16
+ - run: gem update --system
17
+ - run: gem install bundler
18
+ - run: bundle install --path vendor/bundle
19
+ - run: sudo apt install postgresql-client
20
+ - run: dockerize -wait tcp://localhost:5432 -timeout 1m
21
+ - run:
22
+ name: Run specs
23
+ command: |
24
+ bundle exec rspec spec/
25
+ workflows:
26
+ version: 2
27
+ test:
28
+ jobs:
29
+ - test
data/.gitignore CHANGED
@@ -2,3 +2,5 @@ Gemfile.lock
2
2
  .ruby-version
3
3
  pkg/
4
4
  *.gem
5
+ docker-compose.yml
6
+
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rails PG Extras [![Gem Version](https://badge.fury.io/rb/rails-pg-extras.svg)](https://badge.fury.io/rb/rails-pg-extras)
1
+ # Rails PG Extras [![Gem Version](https://badge.fury.io/rb/rails-pg-extras.svg)](https://badge.fury.io/rb/rails-pg-extras) [![CircleCI](https://circleci.com/gh/pawurb/rails-pg-extras.svg?style=svg)](https://circleci.com/gh/pawurb/rails-pg-extras)
2
2
 
3
3
  Rails port of [Heroku PG Extras](https://github.com/heroku/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.
4
4
 
@@ -1,3 +1,3 @@
1
1
  module RailsPGExtras
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -12,8 +12,12 @@ Gem::Specification.new do |gem|
12
12
  gem.description = %q{ Rails 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
13
  gem.homepage = "http://github.com/pawurb/rails-pg-extras"
14
14
  gem.files = `git ls-files`.split("\n")
15
+ gem.test_files = gem.files.grep(%r{^(spec)/})
15
16
  gem.require_paths = ["lib"]
16
17
  gem.license = "MIT"
17
18
  gem.add_dependency "activerecord"
19
+ gem.add_dependency "pg"
18
20
  gem.add_dependency "terminal-table"
21
+ gem.add_development_dependency "rake"
22
+ gem.add_development_dependency "rspec"
19
23
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe RailsPGExtras do
6
+ RailsPGExtras::QUERIES.each do |query_name|
7
+ it "#{query_name} description can be read" do
8
+ expect do
9
+ RailsPGExtras.description_for(
10
+ query_name: query_name
11
+ )
12
+ end.not_to raise_error
13
+ end
14
+ end
15
+
16
+ PG_STATS_DEPENDENT_QUERIES = %i(calls outliers)
17
+
18
+ (RailsPGExtras::QUERIES - PG_STATS_DEPENDENT_QUERIES).each do |query_name|
19
+ it "#{query_name} query can be executed" do
20
+ expect do
21
+ result = RailsPGExtras.run_query(
22
+ query_name: query_name,
23
+ in_format: :hash
24
+ )
25
+ end.not_to raise_error
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+ require 'active_record'
6
+ require_relative '../lib/rails-pg-extras'
7
+
8
+ ENV["DATABASE_URL"] ||= "postgresql://postgres:secret@localhost:5432/rails-pg-extras-test"
9
+
10
+ RSpec.configure do |config|
11
+ config.before :suite do
12
+ ActiveRecord::Base.establish_connection(
13
+ ENV.fetch("DATABASE_URL")
14
+ )
15
+ end
16
+
17
+ config.after :suite do
18
+ ActiveRecord::Base.remove_connection
19
+ end
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pg-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-30 00:00:00.000000000 Z
11
+ date: 2020-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pg
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: terminal-table
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +52,34 @@ dependencies:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
41
83
  description: " Rails port of Heroku PG Extras. The goal of this project is to provide
42
84
  a powerful insights into PostgreSQL database for Ruby on Rails apps that are not
43
85
  using the default Heroku PostgreSQL plugin. "
@@ -47,6 +89,7 @@ executables: []
47
89
  extensions: []
48
90
  extra_rdoc_files: []
49
91
  files:
92
+ - ".circleci/config.yml"
50
93
  - ".gitignore"
51
94
  - Gemfile
52
95
  - LICENSE.txt
@@ -77,6 +120,8 @@ files:
77
120
  - lib/rails-pg-extras/tasks/all.rake
78
121
  - lib/rails-pg-extras/version.rb
79
122
  - rails-pg-extras.gemspec
123
+ - spec/smoke_spec.rb
124
+ - spec/spec_helper.rb
80
125
  homepage: http://github.com/pawurb/rails-pg-extras
81
126
  licenses:
82
127
  - MIT
@@ -96,8 +141,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
141
  - !ruby/object:Gem::Version
97
142
  version: '0'
98
143
  requirements: []
99
- rubygems_version: 3.0.3
144
+ rubygems_version: 3.0.6
100
145
  signing_key:
101
146
  specification_version: 4
102
147
  summary: Rails PostgreSQL performance database insights
103
- test_files: []
148
+ test_files:
149
+ - spec/smoke_spec.rb
150
+ - spec/spec_helper.rb