rails_sql_prettifier 6.0.2 → 6.0.3

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: dc8698d2cb6da1287057ee6d57f4fa1d494efa19bcc013157012d0a055176243
4
- data.tar.gz: 6e41b147fd207cc2ad6afcd48508b1ebb0e6cf183d5d3829b61fffff71e1ed30
3
+ metadata.gz: f1ee709955e95f1203d8f1e64feb5e51309123c92f7eeeee50fa44d9688511c3
4
+ data.tar.gz: b44477d11671c84097e66e2b69393a458f9a57cd2ab0c6aa4507e23105af3f80
5
5
  SHA512:
6
- metadata.gz: 4b2da81bae482d9269ae444ceb7c58b73c0d769755b45d2455656169c117bfe22a18ec0288989689479c385afa5c86f00ae826f3c477d5b987e04e3da97acdcf
7
- data.tar.gz: 6030b09100f99471a4874b4f30ccea42184a76eda6f6a7d8a1cb89233498f2b403766ef14981fdfaef15cca1413cdbeb9e5f17fb31e91e07729d779dd609a470
6
+ metadata.gz: 84862ea11984c33d2c198a6c7a0ec340a4f90d35463abe971280580e1f3f4d97db47486c838c13e854898c8c01c4d511fd2f74f5ab57068667159f2218d1cda8
7
+ data.tar.gz: 9e72db1724def7dc7fec82a5198281badc9b81fba4bcc01f3a51dfae23fd4ef1700f2369db7312fb97497c1c1caa2dbee0cb4b526466feb5a8887802b33f0f8f
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
- # 6.0.2
1
+ # 6.0.3
2
+ * Fixed issue with Niceql.configure not configuring anything + test covered
3
+
4
+ #6.0.2
2
5
 
3
6
  * This a active record prior to 7.0 version and >= 6.1 compatible niceql integration
4
7
  ar < 6.0 breaking change:
data/Dockerfile ADDED
@@ -0,0 +1,20 @@
1
+ FROM ruby:2.7.5-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/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # RailsSQLPrettifier
2
2
 
3
- This is an ActiveRecord integration for a niceql gem.
4
- Niceql is a small, nice, simple and zero dependency solution for SQL prettifying for Ruby.
3
+ This is an ActiveRecord integration for a niceql gem ( niceql is a small, nice, simple and zero dependency solution for the SQL prettifying in ruby ).
4
+
5
+ This gem is an extraction from niceql version 0.4.x. Its separated by different ActiveRecord versions, previous it had some version logic branching e.t.c.
6
+ but that is hard to maintain and test, and also breaking the idea of niceql to be dependentless solution, so now niceql is a completely railsfree solution yeay!
5
7
 
6
8
  Any reasonable suggestions are welcome.
7
9
 
@@ -23,6 +25,9 @@ after:
23
25
 
24
26
  ## Installation
25
27
 
28
+ rails_sql_prettifier, has several version compatible with different active_record versions, so pay attention to the right versioning
29
+ if whenever you specify versions manually.
30
+
26
31
  Add this line to your application's Gemfile:
27
32
 
28
33
  ```ruby
@@ -0,0 +1,10 @@
1
+ version: "3.7"
2
+
3
+ services:
4
+ test:
5
+ build: .
6
+ image: niceql
7
+ command: service postgresql start && rake test
8
+ volumes:
9
+ - '.:/app'
10
+
@@ -1,3 +1,3 @@
1
1
  module RailsSQLPrettifier
2
- VERSION = '6.0.2'
2
+ VERSION = '6.0.3'
3
3
  end
@@ -2,8 +2,8 @@ require "rails_sql_prettifier/version"
2
2
  require 'active_record'
3
3
  require "niceql"
4
4
 
5
+
5
6
  module RailsSQLPrettifier
6
- include Niceql
7
7
 
8
8
  module ArExtentions
9
9
  def exec_niceql
@@ -44,7 +44,7 @@ module RailsSQLPrettifier
44
44
  end
45
45
  end
46
46
 
47
- module ARNiceQLConfig
47
+ module NiceQLConfigExt
48
48
  extend ActiveSupport::Concern
49
49
 
50
50
  included do
@@ -64,17 +64,19 @@ module RailsSQLPrettifier
64
64
  self.prettify_active_record_log_output = false
65
65
  self.prettify_pg_errors = ar_using_pg_adapter?
66
66
  end
67
+ end
67
68
 
68
- module ClassMethods
69
- def configure
70
- super
69
+ module NiceqlExt
70
+ def configure
71
+ super
71
72
 
72
- ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.include(PostgresAdapterNiceQL) if config.pg_adapter_with_nicesql
73
+ if config.pg_adapter_with_nicesql && defined?( ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter )
74
+ ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.include( PostgresAdapterNiceQL)
75
+ end
73
76
 
74
- ::ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend( AbstractAdapterLogPrettifier ) if config.prettify_active_record_log_output
77
+ ::ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend( AbstractAdapterLogPrettifier ) if config.prettify_active_record_log_output
75
78
 
76
- ::ActiveRecord::StatementInvalid.include( Niceql::ErrorExt ) if config.prettify_pg_errors && config.ar_using_pg_adapter?
77
- end
79
+ ::ActiveRecord::StatementInvalid.include( RailsSQLPrettifier::ErrorExt ) if config.prettify_pg_errors && config.ar_using_pg_adapter?
78
80
  end
79
81
  end
80
82
 
@@ -82,5 +84,8 @@ module RailsSQLPrettifier
82
84
  ::Arel::TreeManager,
83
85
  ::Arel::Nodes::Node].each { |klass| klass.send(:include, ArExtentions) }
84
86
 
85
- NiceQLConfig.include( ARNiceQLConfig )
87
+ Niceql::NiceQLConfig.include( NiceQLConfigExt )
88
+
89
+ # we need to use a prepend otherwise it's not preceding Niceql.configure in a lookup chain
90
+ Niceql.singleton_class.prepend( NiceqlExt )
86
91
  end
@@ -42,4 +42,7 @@ Gem::Specification.new do |spec|
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
+ spec.add_development_dependency 'pg', '~> 1'
46
+
47
+ spec.add_development_dependency 'stubberry', '~> 0.1'
45
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_sql_prettifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - alekseyl
@@ -128,6 +128,34 @@ dependencies:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '1'
131
+ - !ruby/object:Gem::Dependency
132
+ name: pg
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '1'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '1'
145
+ - !ruby/object:Gem::Dependency
146
+ name: stubberry
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.1'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '0.1'
131
159
  description: 'This is an ActiveRecord integration for the SQL prettifier gem niceql. '
132
160
  email:
133
161
  - leshchuk@gmail.com
@@ -140,12 +168,14 @@ files:
140
168
  - ".ruby-version"
141
169
  - ".travis.yml"
142
170
  - CHANGELOG.md
171
+ - Dockerfile
143
172
  - Gemfile
144
173
  - LICENSE.txt
145
174
  - README.md
146
175
  - Rakefile
147
176
  - bin/console
148
177
  - bin/setup
178
+ - docker-compose.yml
149
179
  - err_now.png
150
180
  - err_was.png
151
181
  - lib/benchmark/cat.rb