mysql_casual_explain 1.0.0 → 1.1.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: aefb7d12a90cb72542348ae0e2d632d3f6567e128853aca59b281cb9ea146d56
4
- data.tar.gz: 62bd776a8bdedf0addf0d4fd44c66896062f74db69acc9199aa0a01901f0b0a6
3
+ metadata.gz: dbb3d88ec938d5956236caabe75c9d6572994148e14dcab790a7c8fae073f09f
4
+ data.tar.gz: e41c71763097e2669a2138c0414b5559b4a084f6fb480b8ed75892febb02e7c9
5
5
  SHA512:
6
- metadata.gz: b8a4aa7f5a8336a783d6f873a6c0a772024ee2189b3594b3a8a9e8ea91ab4e579371177c66e56ab96c01b25d0677c8b2b6b4e5659cf5ebe65cc3a513765bb41c
7
- data.tar.gz: 19f6e05617376147e97a34fa6b6b1895c7d1f171cae460c33c7c3a4a977f84b6674dc3251b7a8128e3769ac848906014a7583c0ee391678b9fd4a5322d67ce18
6
+ metadata.gz: e679418181ca80b2c5a8d2082fe8ec61338b1180460d4a7fe6b1555cc5e82f37a891f1c37509ed08d56f5ed2a646f2416c3ed578effe59613de478d4d5c42e47
7
+ data.tar.gz: aec6a658083f1e4cd3bf5f0bdbd12cea26a9ad4b10f88b6f6152f7869836d9202e81d000041afd4974ea6064084f0292ff3d33d927c510f0b494558a29fdea51
@@ -0,0 +1,52 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ services:
11
+ mysql:
12
+ image: budougumi0617/mysql-sakila:5.7
13
+ ports:
14
+ - 3306:3306
15
+ env:
16
+ MYSQL_ALLOW_EMPTY_PASSWORD: "1"
17
+ options: --health-cmd "mysqladmin ping -h localhost" --health-interval 1s --health-timeout 3s --health-retries 60
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby:
22
+ - 2.5
23
+ - 2.6
24
+ - 2.7
25
+ - 3.0
26
+ gemfile:
27
+ - gemfiles/ar52.gemfile
28
+ - gemfiles/ar60.gemfile
29
+ - gemfiles/ar61.gemfile
30
+ exclude:
31
+ - ruby: 3.0
32
+ gemfile: gemfiles/ar52.gemfile
33
+ env:
34
+ DATABASE_URL: mysql2://root@127.0.0.1/sakila
35
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
36
+ steps:
37
+ - uses: actions/checkout@v2
38
+ - uses: ruby/setup-ruby@v1
39
+ with:
40
+ ruby-version: ${{ matrix.ruby }}
41
+ - uses: actions/cache@v2
42
+ with:
43
+ path: gemfiles/vendor/bundle
44
+ key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}
45
+ restore-keys: |
46
+ ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}
47
+ - name: Setup dependencies
48
+ run: |
49
+ bundle config path vendor/bundle
50
+ bundle install --jobs 4 --retry 3
51
+ - name: Run tests
52
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -6,8 +6,12 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /Gemfile.lock
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
12
13
 
13
14
  /test.rb
15
+
16
+ # Appraisal Gemfile.lock
17
+ /gemfiles/*.lock
@@ -3,6 +3,7 @@ AllCops:
3
3
  - "gemfiles/**/*"
4
4
  - "test.rb"
5
5
  TargetRubyVersion: 2.5
6
+ NewCops: enable
6
7
  Style/Documentation:
7
8
  Enabled: false
8
9
  Style/TrailingCommaInArrayLiteral:
@@ -19,50 +20,3 @@ Metrics/BlockLength:
19
20
  Enabled: false
20
21
  Layout/LineLength:
21
22
  Enabled: false
22
-
23
- Layout/EmptyLinesAroundAttributeAccessor:
24
- Enabled: true
25
- Layout/SpaceAroundMethodCallOperator:
26
- Enabled: true
27
- Lint/DeprecatedOpenSSLConstant:
28
- Enabled: true
29
- Lint/DuplicateElsifCondition:
30
- Enabled: true
31
- Lint/MixedRegexpCaptureTypes:
32
- Enabled: true
33
- Lint/RaiseException:
34
- Enabled: true
35
- Lint/StructNewOverride:
36
- Enabled: true
37
- Style/AccessorGrouping:
38
- Enabled: true
39
- Style/ArrayCoercion:
40
- Enabled: true
41
- Style/BisectedAttrAccessor:
42
- Enabled: true
43
- Style/CaseLikeIf:
44
- Enabled: true
45
- Style/ExponentialNotation:
46
- Enabled: true
47
- Style/HashAsLastArrayItem:
48
- Enabled: true
49
- Style/HashEachMethods:
50
- Enabled: true
51
- Style/HashLikeCase:
52
- Enabled: true
53
- Style/HashTransformKeys:
54
- Enabled: true
55
- Style/HashTransformValues:
56
- Enabled: true
57
- Style/RedundantAssignment:
58
- Enabled: true
59
- Style/RedundantFetchBlock:
60
- Enabled: true
61
- Style/RedundantFileExtensionInRequire:
62
- Enabled: true
63
- Style/RedundantRegexpCharacterClass:
64
- Enabled: true
65
- Style/RedundantRegexpEscape:
66
- Enabled: true
67
- Style/SlicingWithRange:
68
- Enabled: true
data/Appraisals CHANGED
@@ -7,3 +7,7 @@ end
7
7
  appraise 'ar60' do
8
8
  gem 'activerecord', '~> 6.0.3'
9
9
  end
10
+
11
+ appraise 'ar61' do
12
+ gem 'activerecord', '~> 6.1'
13
+ end
data/README.md CHANGED
@@ -4,6 +4,8 @@ Highlight problematic MySQL explain results.
4
4
 
5
5
  Inspired by [MySQLCasualLog.pm](https://gist.github.com/kamipo/839e8a5b6d12bddba539).
6
6
 
7
+ [![Build Status](https://github.com/winebarrel/mysql_casual_explain/workflows/test/badge.svg?branch=master)](https://github.com/winebarrel/mysql_casual_explain/actions)
8
+
7
9
  ## Installation
8
10
 
9
11
  Add this line to your application's Gemfile:
@@ -33,7 +35,6 @@ ActiveRecord::Base.establish_connection(
33
35
  database: 'employees'
34
36
  )
35
37
 
36
-
37
38
  class Employee < ActiveRecord::Base; end
38
39
 
39
40
  puts Employee.all.explain
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 12.0"
6
+ gem "rspec", "~> 3.0"
7
+ gem "activerecord", "~> 6.1"
8
+
9
+ gemspec path: "../"
@@ -23,7 +23,7 @@ module MysqlCasualExplain
23
23
  pp << separator
24
24
  pp << build_footer(result.rows.length, elapsed)
25
25
 
26
- pp.join("\n") + "\n"
26
+ "#{pp.join("\n")}\n"
27
27
  end
28
28
 
29
29
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MysqlCasualExplain
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'Highlight problematic MySQL explain results.'
13
13
  spec.homepage = 'https://github.com/winebarrel/mysql_casual_explain'
14
14
  spec.license = 'MIT'
15
- spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
16
16
 
17
17
  # Specify which files should be added to the gem when it is released.
18
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -23,11 +23,13 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.add_dependency 'activerecord'
26
+ spec.add_dependency 'activerecord', '>= 5.2'
27
27
  spec.add_development_dependency 'appraisal'
28
28
  spec.add_development_dependency 'bundler'
29
29
  spec.add_development_dependency 'mysql2'
30
30
  spec.add_development_dependency 'rake'
31
31
  spec.add_development_dependency 'rspec'
32
- spec.add_development_dependency 'rubocop'
32
+ spec.add_development_dependency 'rubocop', '>= 1.8.1'
33
+ spec.add_development_dependency 'rubocop-rake'
34
+ spec.add_development_dependency 'rubocop-rspec'
33
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql_casual_explain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-05 00:00:00.000000000 Z
11
+ date: 2021-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '5.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '5.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +96,34 @@ dependencies:
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: 1.8.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 1.8.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rspec
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
129
  - - ">="
@@ -115,22 +143,21 @@ executables: []
115
143
  extensions: []
116
144
  extra_rdoc_files: []
117
145
  files:
146
+ - ".github/workflows/test.yml"
118
147
  - ".gitignore"
119
148
  - ".rspec"
120
149
  - ".rubocop.yml"
121
- - ".travis.yml"
122
150
  - Appraisals
123
151
  - Dockerfile
124
152
  - Gemfile
125
- - Gemfile.lock
126
153
  - LICENSE.txt
127
154
  - README.md
128
155
  - Rakefile
129
156
  - docker-compose.yml
157
+ - gemfiles/.bundle/config
130
158
  - gemfiles/ar52.gemfile
131
- - gemfiles/ar52.gemfile.lock
132
159
  - gemfiles/ar60.gemfile
133
- - gemfiles/ar60.gemfile.lock
160
+ - gemfiles/ar61.gemfile
134
161
  - lib/mysql_casual_explain.rb
135
162
  - lib/mysql_casual_explain/config.rb
136
163
  - lib/mysql_casual_explain/pretty_printer.rb
@@ -140,7 +167,7 @@ homepage: https://github.com/winebarrel/mysql_casual_explain
140
167
  licenses:
141
168
  - MIT
142
169
  metadata: {}
143
- post_install_message:
170
+ post_install_message:
144
171
  rdoc_options: []
145
172
  require_paths:
146
173
  - lib
@@ -148,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
175
  requirements:
149
176
  - - ">="
150
177
  - !ruby/object:Gem::Version
151
- version: 2.3.0
178
+ version: 2.5.0
152
179
  required_rubygems_version: !ruby/object:Gem::Requirement
153
180
  requirements:
154
181
  - - ">="
@@ -156,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
183
  version: '0'
157
184
  requirements: []
158
185
  rubygems_version: 3.0.3
159
- signing_key:
186
+ signing_key:
160
187
  specification_version: 4
161
188
  summary: Highlight problematic MySQL explain results.
162
189
  test_files: []
@@ -1,22 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.5.8
6
- - 2.6.6
7
- - 2.7.1
8
- gemfile:
9
- - gemfiles/ar52.gemfile
10
- - gemfiles/ar60.gemfile
11
- services:
12
- - mysql
13
- env:
14
- - DATABASE_URL=mysql2://travis@localhost/sakila
15
- before_install:
16
- - gem install bundler -v 2.1.2
17
- - curl -sSfL https://downloads.mysql.com/docs/sakila-db.tar.gz -o - | tar zxf -
18
- - cd sakila-db
19
- - mysql < sakila-schema.sql
20
- - mysql < sakila-data.sql
21
- script:
22
- - bundle exec rake
@@ -1,84 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- mysql_casual_explain (1.0.0)
5
- activerecord
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activemodel (6.0.3.2)
11
- activesupport (= 6.0.3.2)
12
- activerecord (6.0.3.2)
13
- activemodel (= 6.0.3.2)
14
- activesupport (= 6.0.3.2)
15
- activesupport (6.0.3.2)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (>= 0.7, < 2)
18
- minitest (~> 5.1)
19
- tzinfo (~> 1.1)
20
- zeitwerk (~> 2.2, >= 2.2.2)
21
- appraisal (2.3.0)
22
- bundler
23
- rake
24
- thor (>= 0.14.0)
25
- ast (2.4.1)
26
- concurrent-ruby (1.1.6)
27
- diff-lcs (1.4.4)
28
- i18n (1.8.4)
29
- concurrent-ruby (~> 1.0)
30
- minitest (5.14.1)
31
- mysql2 (0.5.3)
32
- parallel (1.19.2)
33
- parser (2.7.1.4)
34
- ast (~> 2.4.1)
35
- rainbow (3.0.0)
36
- rake (12.3.3)
37
- regexp_parser (1.7.1)
38
- rexml (3.2.4)
39
- rspec (3.9.0)
40
- rspec-core (~> 3.9.0)
41
- rspec-expectations (~> 3.9.0)
42
- rspec-mocks (~> 3.9.0)
43
- rspec-core (3.9.2)
44
- rspec-support (~> 3.9.3)
45
- rspec-expectations (3.9.2)
46
- diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.9.0)
48
- rspec-mocks (3.9.1)
49
- diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.9.0)
51
- rspec-support (3.9.3)
52
- rubocop (0.88.0)
53
- parallel (~> 1.10)
54
- parser (>= 2.7.1.1)
55
- rainbow (>= 2.2.2, < 4.0)
56
- regexp_parser (>= 1.7)
57
- rexml
58
- rubocop-ast (>= 0.1.0, < 1.0)
59
- ruby-progressbar (~> 1.7)
60
- unicode-display_width (>= 1.4.0, < 2.0)
61
- rubocop-ast (0.1.0)
62
- parser (>= 2.7.0.1)
63
- ruby-progressbar (1.10.1)
64
- thor (1.0.1)
65
- thread_safe (0.3.6)
66
- tzinfo (1.2.7)
67
- thread_safe (~> 0.1)
68
- unicode-display_width (1.7.0)
69
- zeitwerk (2.4.0)
70
-
71
- PLATFORMS
72
- ruby
73
-
74
- DEPENDENCIES
75
- appraisal
76
- bundler
77
- mysql2
78
- mysql_casual_explain!
79
- rake (~> 12.0)
80
- rspec (~> 3.0)
81
- rubocop
82
-
83
- BUNDLED WITH
84
- 2.1.4
@@ -1,85 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- mysql_casual_explain (0.1.0)
5
- activerecord
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activemodel (5.2.4.3)
11
- activesupport (= 5.2.4.3)
12
- activerecord (5.2.4.3)
13
- activemodel (= 5.2.4.3)
14
- activesupport (= 5.2.4.3)
15
- arel (>= 9.0)
16
- activesupport (5.2.4.3)
17
- concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (>= 0.7, < 2)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- appraisal (2.3.0)
22
- bundler
23
- rake
24
- thor (>= 0.14.0)
25
- arel (9.0.0)
26
- ast (2.4.1)
27
- concurrent-ruby (1.1.6)
28
- diff-lcs (1.4.4)
29
- i18n (1.8.4)
30
- concurrent-ruby (~> 1.0)
31
- minitest (5.14.1)
32
- mysql2 (0.5.3)
33
- parallel (1.19.2)
34
- parser (2.7.1.4)
35
- ast (~> 2.4.1)
36
- rainbow (3.0.0)
37
- rake (12.3.3)
38
- regexp_parser (1.7.1)
39
- rexml (3.2.4)
40
- rspec (3.9.0)
41
- rspec-core (~> 3.9.0)
42
- rspec-expectations (~> 3.9.0)
43
- rspec-mocks (~> 3.9.0)
44
- rspec-core (3.9.2)
45
- rspec-support (~> 3.9.3)
46
- rspec-expectations (3.9.2)
47
- diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.9.0)
49
- rspec-mocks (3.9.1)
50
- diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.9.0)
52
- rspec-support (3.9.3)
53
- rubocop (0.88.0)
54
- parallel (~> 1.10)
55
- parser (>= 2.7.1.1)
56
- rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 1.7)
58
- rexml
59
- rubocop-ast (>= 0.1.0, < 1.0)
60
- ruby-progressbar (~> 1.7)
61
- unicode-display_width (>= 1.4.0, < 2.0)
62
- rubocop-ast (0.1.0)
63
- parser (>= 2.7.0.1)
64
- ruby-progressbar (1.10.1)
65
- thor (1.0.1)
66
- thread_safe (0.3.6)
67
- tzinfo (1.2.7)
68
- thread_safe (~> 0.1)
69
- unicode-display_width (1.7.0)
70
-
71
- PLATFORMS
72
- ruby
73
-
74
- DEPENDENCIES
75
- activerecord (~> 5.2.1)
76
- appraisal
77
- bundler
78
- mysql2
79
- mysql_casual_explain!
80
- rake (~> 12.0)
81
- rspec (~> 3.0)
82
- rubocop
83
-
84
- BUNDLED WITH
85
- 2.1.4
@@ -1,85 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- mysql_casual_explain (0.1.0)
5
- activerecord
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activemodel (6.0.3.2)
11
- activesupport (= 6.0.3.2)
12
- activerecord (6.0.3.2)
13
- activemodel (= 6.0.3.2)
14
- activesupport (= 6.0.3.2)
15
- activesupport (6.0.3.2)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (>= 0.7, < 2)
18
- minitest (~> 5.1)
19
- tzinfo (~> 1.1)
20
- zeitwerk (~> 2.2, >= 2.2.2)
21
- appraisal (2.3.0)
22
- bundler
23
- rake
24
- thor (>= 0.14.0)
25
- ast (2.4.1)
26
- concurrent-ruby (1.1.6)
27
- diff-lcs (1.4.4)
28
- i18n (1.8.4)
29
- concurrent-ruby (~> 1.0)
30
- minitest (5.14.1)
31
- mysql2 (0.5.3)
32
- parallel (1.19.2)
33
- parser (2.7.1.4)
34
- ast (~> 2.4.1)
35
- rainbow (3.0.0)
36
- rake (12.3.3)
37
- regexp_parser (1.7.1)
38
- rexml (3.2.4)
39
- rspec (3.9.0)
40
- rspec-core (~> 3.9.0)
41
- rspec-expectations (~> 3.9.0)
42
- rspec-mocks (~> 3.9.0)
43
- rspec-core (3.9.2)
44
- rspec-support (~> 3.9.3)
45
- rspec-expectations (3.9.2)
46
- diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.9.0)
48
- rspec-mocks (3.9.1)
49
- diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.9.0)
51
- rspec-support (3.9.3)
52
- rubocop (0.88.0)
53
- parallel (~> 1.10)
54
- parser (>= 2.7.1.1)
55
- rainbow (>= 2.2.2, < 4.0)
56
- regexp_parser (>= 1.7)
57
- rexml
58
- rubocop-ast (>= 0.1.0, < 1.0)
59
- ruby-progressbar (~> 1.7)
60
- unicode-display_width (>= 1.4.0, < 2.0)
61
- rubocop-ast (0.1.0)
62
- parser (>= 2.7.0.1)
63
- ruby-progressbar (1.10.1)
64
- thor (1.0.1)
65
- thread_safe (0.3.6)
66
- tzinfo (1.2.7)
67
- thread_safe (~> 0.1)
68
- unicode-display_width (1.7.0)
69
- zeitwerk (2.4.0)
70
-
71
- PLATFORMS
72
- ruby
73
-
74
- DEPENDENCIES
75
- activerecord (~> 6.0.3)
76
- appraisal
77
- bundler
78
- mysql2
79
- mysql_casual_explain!
80
- rake (~> 12.0)
81
- rspec (~> 3.0)
82
- rubocop
83
-
84
- BUNDLED WITH
85
- 2.1.4