prosopite 0.2.1 → 1.0.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: a5c95516b64f760903487cb161f0e507cd960a21770bd2729d39fd219526ce99
4
- data.tar.gz: 890f117df692947849ffb243dff96ddfb1b808b0728bd5a5e613969eb2b11838
3
+ metadata.gz: 3df6a0299972911e48ea44330995864e2cd2191ec66c199296ba324a5fa8e639
4
+ data.tar.gz: 4f9ee347a8cf52fd742ee66586c7e4b601c8436a4bcabe1b1afdef5e09293f44
5
5
  SHA512:
6
- metadata.gz: 991261e0e5cb2002e2031e4d2a53c620732752425a77dee6d3fd63b06acb779cdba11aebd61531922beafc67492cc41eaa222f33a53c843e01660fe1a7b268f2
7
- data.tar.gz: 6a09687449111aabcea1cc7d58a64b325e8115504b557b41fd8bf313666eb8098713eda6aaa9d37f83716159c62cfcdce78444ed422dc6a43e40c8568e8237a8
6
+ metadata.gz: 668bc7e58bcabd77231adc831054d56ca572e1e9857f87736d1fd06048c1eeaac9c0c0ab970c6ed6f8ce70670ae51277c3c4f56012d0ec61240c0e728c1f3795
7
+ data.tar.gz: '0341920f4f1beddc2b9c46553f9284724ecddfe50f30579a7cc9627c93fdf2d3c714bb57fd453dd7a4783a86951b9dd2cb0a79e721189bce3b89eda0c119c8bf'
data/Gemfile CHANGED
@@ -5,3 +5,4 @@ source "https://rubygems.org"
5
5
  gemspec
6
6
 
7
7
  gem "rake", "~> 13.0"
8
+ gem 'pg_query'
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- prosopite (0.2.0)
5
- pg_query (~> 1.3)
4
+ prosopite (0.2.1)
6
5
 
7
6
  GEM
8
7
  remote: https://rubygems.org/
@@ -44,6 +43,7 @@ DEPENDENCIES
44
43
  activerecord
45
44
  factory_bot
46
45
  minitest
46
+ pg_query
47
47
  prosopite!
48
48
  pry
49
49
  rake (~> 13.0)
data/README.md CHANGED
@@ -97,6 +97,12 @@ Add this line to your application's Gemfile:
97
97
  gem 'prosopite'
98
98
  ```
99
99
 
100
+ If you're **not** using MySQL/MariaDB, you should also add:
101
+
102
+ ```ruby
103
+ gem 'pg_query'
104
+ ```
105
+
100
106
  And then execute:
101
107
 
102
108
  $ bundle install
data/lib/prosopite.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'pg_query'
2
1
 
3
2
  module Prosopite
4
3
  class NPlusOneQueriesError < StandardError; end
@@ -71,6 +70,12 @@ module Prosopite
71
70
  if ActiveRecord::Base.connection.adapter_name.downcase.include?('mysql')
72
71
  mysql_fingerprint(query)
73
72
  else
73
+ begin
74
+ require 'pg_query'
75
+ rescue LoadError => e
76
+ msg = "Could not load the 'pg_query' gem. Add `gem 'pg_query'` to your Gemfile"
77
+ raise LoadError, msg, e.backtrace
78
+ end
74
79
  PgQuery.fingerprint(query)
75
80
  end
76
81
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prosopite
4
- VERSION = "0.2.1"
4
+ VERSION = "1.0.0"
5
5
  end
data/prosopite.gemspec CHANGED
@@ -24,8 +24,6 @@ Gem::Specification.new do |spec|
24
24
  end
25
25
  spec.require_paths = ["lib"]
26
26
 
27
- spec.add_runtime_dependency 'pg_query', '~> 1.3'
28
-
29
27
  spec.add_development_dependency "pry"
30
28
  spec.add_development_dependency "minitest"
31
29
  spec.add_development_dependency "factory_bot"
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prosopite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mpampis Kostas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
11
+ date: 2021-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: pg_query
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.3'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: pry
29
15
  requirement: !ruby/object:Gem::Requirement