rails_sql_prettifier 5.0.3 → 6.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -1
- data/CHANGELOG.md +12 -6
- data/Dockerfile_30 +20 -0
- data/docker-compose.yml +11 -2
- data/lib/rails_sql_prettifier/version.rb +1 -1
- data/lib/rails_sql_prettifier.rb +4 -2
- data/rails_sql_prettifier.gemspec +3 -3
- metadata +27 -7
- data/.byebug_history +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd0305095915e20ebc2a5b5529c0681f4e82795c1dd748764185c2aeef922298
|
4
|
+
data.tar.gz: 286a20bb4acc2213dd4d8fe3e97f48977857360d2ab65a6b03f8d017f4add700
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3010b72fd84d20a273ae11880a624a2758158354249abd1534020810d94f20297a8d73306ed36b31ad69fe24a9367931e59cc4b07fe90b9d57a9743122c2bef
|
7
|
+
data.tar.gz: 2c06865138f0a7fe2c407673f567b4c1721c7ac799598ec0252682d995808c7bfd26fe11236895f9d7749768e48dbebf4e08517a7f68ae7196331d9c31a89d89
|
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
rails_sql_prettifier_ar_6_0
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,16 @@
|
|
1
|
-
#
|
2
|
-
*
|
1
|
+
#6.0.5
|
2
|
+
* fixed issue [#20](https://github.com/alekseyl/niceql/issues/20)
|
3
|
+
* adding support for multiple ruby versions testing using docker-compose
|
3
4
|
|
4
|
-
#
|
5
|
+
# 6.0.4
|
6
|
+
* Now AR is a dependency not a development dependency
|
7
|
+
|
8
|
+
# 6.0.3
|
5
9
|
* Fixed issue with Niceql.configure not configuring anything + test covered
|
6
10
|
|
7
|
-
#
|
11
|
+
#6.0.2
|
8
12
|
|
9
|
-
* This a active record prior to
|
10
|
-
|
13
|
+
* This a active record prior to 7.0 version and >= 6.1 compatible niceql integration
|
14
|
+
ar < 6.0 breaking change:
|
15
|
+
* StatementInvalid initialization has a breaking change: starting version 6 it has named param sql: for original query )
|
16
|
+
|
data/Dockerfile_30
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
FROM ruby:3.0.3-bullseye
|
2
|
+
|
3
|
+
WORKDIR /app
|
4
|
+
RUN apt-get update && apt-get -y install lsb-release
|
5
|
+
#
|
6
|
+
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
|
7
|
+
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
|
8
|
+
apt-get update && apt-get -y install postgresql postgresql-client-12
|
9
|
+
|
10
|
+
RUN sh -c 'echo "local all all trust" > /etc/postgresql/14/main/pg_hba.conf' && \
|
11
|
+
service postgresql start && \
|
12
|
+
psql -U postgres -c 'CREATE DATABASE "niceql-test"'
|
13
|
+
|
14
|
+
RUN gem install bundler
|
15
|
+
|
16
|
+
COPY lib/rails_sql_prettifier/version.rb /app/lib/rails_sql_prettifier/version.rb
|
17
|
+
COPY rails_sql_prettifier.gemspec /app/
|
18
|
+
COPY Gemfil* /app/
|
19
|
+
#
|
20
|
+
RUN bundle install
|
data/docker-compose.yml
CHANGED
@@ -3,8 +3,17 @@ version: "3.7"
|
|
3
3
|
services:
|
4
4
|
test:
|
5
5
|
build: .
|
6
|
-
image:
|
7
|
-
command: service postgresql start && rake test
|
6
|
+
image: rsp_6_0
|
7
|
+
command: /bin/bash -c 'service postgresql start && rake test'
|
8
|
+
volumes:
|
9
|
+
- '.:/app'
|
10
|
+
|
11
|
+
test_3_0:
|
12
|
+
build:
|
13
|
+
context: .
|
14
|
+
dockerfile: Dockerfile_30
|
15
|
+
image: rsp_6_0_3_0
|
16
|
+
command: /bin/bash -c 'service postgresql start && rake test'
|
8
17
|
volumes:
|
9
18
|
- '.:/app'
|
10
19
|
|
data/lib/rails_sql_prettifier.rb
CHANGED
@@ -28,11 +28,13 @@ module RailsSQLPrettifier
|
|
28
28
|
end
|
29
29
|
|
30
30
|
module AbstractAdapterLogPrettifier
|
31
|
-
|
31
|
+
private
|
32
|
+
def log( sql, *args, **kwargs, &block )
|
32
33
|
# \n need to be placed because AR log will start with action description + time info.
|
33
34
|
# rescue sql - just to be sure Prettifier wouldn't break production
|
34
35
|
formatted_sql = "\n" + Niceql::Prettifier.prettify_sql(sql) rescue sql
|
35
|
-
|
36
|
+
|
37
|
+
super( formatted_sql, *args, **kwargs, &block )
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
@@ -32,17 +32,17 @@ Gem::Specification.new do |spec|
|
|
32
32
|
|
33
33
|
spec.required_ruby_version = '>= 2.4'
|
34
34
|
spec.add_dependency "niceql", '~> 0.5'
|
35
|
-
|
36
|
-
spec.add_dependency "activerecord", "< 6.0"
|
35
|
+
spec.add_dependency "activerecord", '>= 6.0', '< 6.1'
|
37
36
|
|
38
37
|
spec.add_development_dependency "bundler", ">= 1"
|
39
38
|
spec.add_development_dependency "rake", ">= 12.3.3"
|
40
39
|
spec.add_development_dependency "minitest", "~> 5.0"
|
41
40
|
|
41
|
+
spec.add_development_dependency "awesome_print"
|
42
42
|
spec.add_development_dependency "differ", '~> 0.1'
|
43
43
|
spec.add_development_dependency "pry-byebug", '~> 3.9'
|
44
44
|
spec.add_development_dependency 'sqlite3', '~> 1'
|
45
45
|
spec.add_development_dependency 'pg', '~> 1'
|
46
46
|
|
47
|
-
spec.add_development_dependency 'stubberry', '~> 0.
|
47
|
+
spec.add_development_dependency 'stubberry', '~> 0.2'
|
48
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_sql_prettifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alekseyl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: niceql
|
@@ -28,16 +28,22 @@ dependencies:
|
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '6.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '6.1'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '6.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '6.1'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: bundler
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +86,20 @@ dependencies:
|
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
88
|
version: '5.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: awesome_print
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
83
103
|
- !ruby/object:Gem::Dependency
|
84
104
|
name: differ
|
85
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +162,14 @@ dependencies:
|
|
142
162
|
requirements:
|
143
163
|
- - "~>"
|
144
164
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0.
|
165
|
+
version: '0.2'
|
146
166
|
type: :development
|
147
167
|
prerelease: false
|
148
168
|
version_requirements: !ruby/object:Gem::Requirement
|
149
169
|
requirements:
|
150
170
|
- - "~>"
|
151
171
|
- !ruby/object:Gem::Version
|
152
|
-
version: '0.
|
172
|
+
version: '0.2'
|
153
173
|
description: 'This is an ActiveRecord integration for the SQL prettifier gem niceql. '
|
154
174
|
email:
|
155
175
|
- leshchuk@gmail.com
|
@@ -157,13 +177,13 @@ executables: []
|
|
157
177
|
extensions: []
|
158
178
|
extra_rdoc_files: []
|
159
179
|
files:
|
160
|
-
- ".byebug_history"
|
161
180
|
- ".gitignore"
|
162
181
|
- ".ruby-gemset"
|
163
182
|
- ".ruby-version"
|
164
183
|
- ".travis.yml"
|
165
184
|
- CHANGELOG.md
|
166
185
|
- Dockerfile
|
186
|
+
- Dockerfile_30
|
167
187
|
- Gemfile
|
168
188
|
- LICENSE.txt
|
169
189
|
- README.md
|
data/.byebug_history
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
exit
|
2
|
-
ActiveRecord::Base.connection_config[:adapter]
|
3
|
-
ActiveRecord::Base.connection_config.adapter
|
4
|
-
ActiveRecord::Base.connection_config
|
5
|
-
c
|
6
|
-
ActiveRecord.version <= Gem::Version.new(5)
|
7
|
-
c
|
8
|
-
ActiveRecord.version
|
9
|
-
exit
|
10
|
-
ActiveRecord.version
|
11
|
-
c
|
12
|
-
exit
|
13
|
-
si.sql
|
14
|
-
si
|
15
|
-
c
|
16
|
-
sql_body
|
17
|
-
n
|
18
|
-
s
|
19
|
-
original_sql_query
|
20
|
-
err
|
21
|
-
s
|
22
|
-
up
|
23
|
-
s
|
24
|
-
up
|
25
|
-
s
|
26
|
-
up
|
27
|
-
s
|
28
|
-
super
|
29
|
-
try(:sql)
|
30
|
-
Niceql.config.prettify_pg_errors
|
31
|
-
c
|
32
|
-
exit
|
33
|
-
err_template
|
34
|
-
si.to_s
|
35
|
-
exit
|
36
|
-
err_caret_line
|
37
|
-
err_quote_caret_offset
|
38
|
-
c
|
39
|
-
err.lines[1].index( '...' ).to_i
|
40
|
-
err_caret_line
|