index_shotgun 1.0.1 → 1.0.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: 177ae0bdc732e173f7813384773d2d1d7494a3427a2e9683caafdc2c7dde5112
4
- data.tar.gz: 8d671561f7c7aa86a4169eef4ed7e7f35fd39279e5809e13acbbd8b1a9892e70
3
+ metadata.gz: 1a2170564fedea98e55841bdf9c3c775e9d17f82829cd0a4f4e6e373152187ff
4
+ data.tar.gz: bd302f0a23894d679d67e0e32379f6a2a0631a69af57a5e5ae0ac2c04ad39edd
5
5
  SHA512:
6
- metadata.gz: 523d34c9aad011951a1b76beb8e55a7ff07282a83b830d19f2029966e6100f75de8ea9aa1a9df77c3fe4f464076866629b7e031168156c4d19434cd2cff5c6d9
7
- data.tar.gz: a5319c356f1f834e5b294cfc844f5eb8b578172de2650eff782f0987ac2a847ec0cde84e73db398773e65345ef13361bf7e9efc48ffd7e4be9eeef157a95fbfb
6
+ metadata.gz: ee13a990a519dee3c290e94782924c6d1a9eed815ebc7444867c82855e6e7600ae3ab844b882ce1149f6264ba6b122dadd5e9153e8c84dbe5dd761ddff7c9a12
7
+ data.tar.gz: d49b22e234b7b96d20b559872a43780359ae81241465871bd6a8205d58aeaa215c36097d28357fadfed5cbae19e40c887e3e9bd5207d717638a74bad5d5ae1a9
@@ -0,0 +1,10 @@
1
+ # c.f. https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2
+ version: 2
3
+
4
+ updates:
5
+ - package-ecosystem: github-actions
6
+ directory: /
7
+ schedule:
8
+ interval: weekly
9
+ assignees:
10
+ - sue445
@@ -0,0 +1,66 @@
1
+ # Simple workflow for deploying static content to GitHub Pages
2
+ name: Deploy static content to Pages
3
+
4
+ on:
5
+ # Runs on pushes targeting the default branch
6
+ push:
7
+ branches:
8
+ - master
9
+ paths-ignore:
10
+ - ".github/workflows/test.yml"
11
+
12
+ # Allows you to run this workflow manually from the Actions tab
13
+ workflow_dispatch:
14
+
15
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16
+ permissions:
17
+ contents: read
18
+ pages: write
19
+ id-token: write
20
+
21
+ # Allow one concurrent deployment
22
+ concurrency:
23
+ group: "pages"
24
+ cancel-in-progress: true
25
+
26
+ jobs:
27
+ # Single deploy job since we're just deploying
28
+ deploy:
29
+ environment:
30
+ name: github-pages
31
+ url: ${{ steps.deployment.outputs.page_url }}
32
+ runs-on: ubuntu-latest
33
+ env:
34
+ BUNDLE_WITHOUT: mysql postgresql sqlite3 oracle
35
+ steps:
36
+ - name: Checkout
37
+ uses: actions/checkout@v4
38
+
39
+ - uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ruby
42
+ bundler-cache: true
43
+
44
+ - run: bundle exec yard
45
+
46
+ - name: Setup Pages
47
+ uses: actions/configure-pages@v4
48
+ - name: Upload artifact
49
+ uses: actions/upload-pages-artifact@v3
50
+ with:
51
+ # Upload entire repository
52
+ path: './doc'
53
+ - name: Deploy to GitHub Pages
54
+ id: deployment
55
+ uses: actions/deploy-pages@main
56
+
57
+ - name: Slack Notification (not success)
58
+ uses: lazy-actions/slatify@master
59
+ if: "! success()"
60
+ continue-on-error: true
61
+ with:
62
+ job_name: "*pages*"
63
+ type: ${{ job.status }}
64
+ icon_emoji: ":octocat:"
65
+ url: ${{ secrets.SLACK_WEBHOOK }}
66
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -4,11 +4,15 @@ on:
4
4
  push:
5
5
  branches:
6
6
  - master
7
+ paths-ignore:
8
+ - ".github/workflows/pages.yml"
7
9
  pull_request:
8
10
  types:
9
11
  - opened
10
12
  - synchronize
11
13
  - reopened
14
+ paths-ignore:
15
+ - ".github/workflows/pages.yml"
12
16
  schedule:
13
17
  - cron: "0 20 * * 5" # JST 5:00 (Sat)
14
18
 
@@ -26,6 +30,9 @@ jobs:
26
30
  - "2.6"
27
31
  - "2.7"
28
32
  - "3.0"
33
+ - "3.1"
34
+ - "3.2"
35
+ - "3.3"
29
36
  gemfile:
30
37
  - activerecord_5_0
31
38
  - activerecord_5_1
@@ -33,16 +40,13 @@ jobs:
33
40
  - activerecord_6_0
34
41
  - activerecord_6_1
35
42
  - activerecord_7_0
43
+ - activerecord_7_1
36
44
  database:
37
45
  - sqlite3
38
46
  - mysql
39
47
  - postgresql
40
48
  - oracle
41
49
  exclude:
42
- # TODO: Remove this after activerecord-oracle_enhanced-adapter supports activerecord v7
43
- - database: oracle
44
- gemfile: activerecord_7_0
45
-
46
50
  # Rails 7.0+ requires Ruby 2.7+
47
51
  - ruby: "2.4"
48
52
  gemfile: activerecord_7_0
@@ -50,6 +54,12 @@ jobs:
50
54
  gemfile: activerecord_7_0
51
55
  - ruby: "2.6"
52
56
  gemfile: activerecord_7_0
57
+ - ruby: "2.4"
58
+ gemfile: activerecord_7_1
59
+ - ruby: "2.5"
60
+ gemfile: activerecord_7_1
61
+ - ruby: "2.6"
62
+ gemfile: activerecord_7_1
53
63
 
54
64
  # Rails 6.0+ requires Ruby 2.5+
55
65
  - ruby: "2.4"
@@ -64,6 +74,28 @@ jobs:
64
74
  gemfile: activerecord_5_1
65
75
  - ruby: "3.0"
66
76
  gemfile: activerecord_5_2
77
+ - ruby: "3.1"
78
+ gemfile: activerecord_5_0
79
+ - ruby: "3.1"
80
+ gemfile: activerecord_5_1
81
+ - ruby: "3.1"
82
+ gemfile: activerecord_5_2
83
+ - ruby: "3.2"
84
+ gemfile: activerecord_5_0
85
+ - ruby: "3.2"
86
+ gemfile: activerecord_5_1
87
+ - ruby: "3.2"
88
+ gemfile: activerecord_5_2
89
+ - ruby: "3.3"
90
+ gemfile: activerecord_5_0
91
+ - ruby: "3.3"
92
+ gemfile: activerecord_5_1
93
+ - ruby: "3.3"
94
+ gemfile: activerecord_5_2
95
+
96
+ # TODO: latest activerecord-oracle_enhanced-adapter doesn't support activerecord 7.1
97
+ - database: oracle
98
+ gemfile: activerecord_7_1
67
99
 
68
100
  env:
69
101
  BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
@@ -99,14 +131,14 @@ jobs:
99
131
  ORACLE_SYSTEM_PASSWORD: oracle
100
132
 
101
133
  steps:
102
- - uses: actions/checkout@v2
134
+ - uses: actions/checkout@v4
103
135
 
104
136
  - uses: ruby/setup-ruby@v1
105
137
  with:
106
138
  ruby-version: ${{ matrix.ruby }}
107
139
 
108
140
  - name: Cache vendor/bundle
109
- uses: actions/cache@v1
141
+ uses: actions/cache@v3
110
142
  id: cache_gem
111
143
  with:
112
144
  path: vendor/bundle
@@ -127,8 +159,8 @@ jobs:
127
159
  command: before-build
128
160
  continue-on-error: true
129
161
 
130
- # c.f. https://github.blog/changelog/2020-02-21-github-actions-breaking-change-ubuntu-virtual-environments-will-no-longer-start-the-mysql-service-automatically/
131
- - run: sudo /etc/init.d/mysql start
162
+ # c.f. https://github.com/actions/virtual-environments/issues/4732#issuecomment-992614476
163
+ - run: sudo systemctl start mysql
132
164
 
133
165
  - name: Run test
134
166
  run: |
@@ -166,14 +198,14 @@ jobs:
166
198
  BUNDLE_WITHOUT: mysql postgresql sqlite3 oracle
167
199
 
168
200
  steps:
169
- - uses: actions/checkout@v1
201
+ - uses: actions/checkout@v4
170
202
 
171
203
  - uses: ruby/setup-ruby@v1
172
204
  with:
173
205
  ruby-version: ${{ env.RUBY_VERSION }}
174
206
 
175
207
  - name: Cache vendor/bundle
176
- uses: actions/cache@v1
208
+ uses: actions/cache@v3
177
209
  id: cache_gem_rubocop
178
210
  with:
179
211
  path: vendor/bundle
data/.yardopts ADDED
@@ -0,0 +1,2 @@
1
+ --markup markdown
2
+ --no-private
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
- [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.1...master)
3
+ [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.2...master)
4
+
5
+ ## [v1.0.2](https://github.com/sue445/index_shotgun/tree/v1.0.2) (2023/12/28)
6
+ [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.1...v1.0.2)
7
+
8
+ * Fixed deprecation warning in activesupport 7.1
9
+ * https://github.com/sue445/index_shotgun/pull/134
4
10
 
5
11
  ## [v1.0.1](https://github.com/sue445/index_shotgun/tree/v1.0.1) (2021/11/20)
6
12
  [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.0...v1.0.1)
data/ci/build.sh CHANGED
@@ -1,5 +1,18 @@
1
1
  #!/bin/bash -xe
2
2
 
3
+ if [ "${DATABASE}" = "mysql" ]; then
4
+ export BUNDLE_WITHOUT="postgresql sqlite3 oracle"
5
+ elif [ "${DATABASE}" = "postgresql" ]; then
6
+ export BUNDLE_WITHOUT="mysql sqlite3 oracle"
7
+ elif [ "${DATABASE}" = "sqlite3" ]; then
8
+ export BUNDLE_WITHOUT="mysql postgresql oracle"
9
+ elif [ "${DATABASE}" = "oracle" ]; then
10
+ export BUNDLE_WITHOUT="mysql postgresql sqlite3"
11
+ else
12
+ echo "${DATABASE} is unknown"
13
+ exit 1
14
+ fi
15
+
3
16
  cp ci/database.yml.${DATABASE} spec/config/database.yml
4
17
  bundle exec rspec --profile
5
18
 
data/ci/install.sh CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/bin/bash -xe
2
2
 
3
- gem install bundler --no-document -v 1.17.3 || true
3
+ gem update --system --quiet || true
4
+
5
+ gem --version
6
+ bundle --version
4
7
 
5
8
  if [ "${DATABASE}" = "mysql" ]; then
6
9
  sudo apt-get update
@@ -44,4 +47,4 @@ else
44
47
  fi
45
48
 
46
49
  bundle config set --local path "vendor/bundle/"
47
- bundle install --jobs $(nproc) --retry 3
50
+ bundle update --jobs $(nproc) --retry 3
@@ -1,26 +1,26 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "activerecord", "~> 7.0.0.alpha2"
3
+ # NOTE: Ruby 3.1 + Rails 7.0.0 doesn't work
4
+ # c.f. https://gist.github.com/yahonda/2776d8d7b6ea7045359f38c10449937b
5
+ gem "activerecord", "~> 7.0.1"
4
6
 
5
7
  group :postgresql do
6
- # c.f. https://github.com/rails/rails/blob/v7.0.0.alpha2/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3
8
+ # c.f. https://github.com/rails/rails/blob/v7.0.0/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3
7
9
  gem "pg", "~> 1.1"
8
10
  end
9
11
 
10
12
  group :mysql do
11
- # c.f. https://github.com/rails/rails/blob/v7.0.0.alpha2/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6
13
+ # c.f. https://github.com/rails/rails/blob/v7.0.0/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6
12
14
  gem "mysql2", "~> 0.5"
13
15
  end
14
16
 
15
17
  group :oracle do
16
- # TODO: Enable this after activerecord-oracle_enhanced-adapter supports activerecord v7
17
- # gem "activerecord-oracle_enhanced-adapter", "~> 6.1.2"
18
-
18
+ gem "activerecord-oracle_enhanced-adapter", "~> 7.0.0"
19
19
  gem "ruby-oci8"
20
20
  end
21
21
 
22
22
  group :sqlite3 do
23
- # c.f. https://github.com/rails/rails/blob/v7.0.0.alpha2/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13
23
+ # c.f. https://github.com/rails/rails/blob/v7.0.0/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13
24
24
  gem "sqlite3", "~> 1.4"
25
25
  end
26
26
 
@@ -0,0 +1,28 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~> 7.1.0"
4
+
5
+ group :postgresql do
6
+ # c.f. https://github.com/rails/rails/blob/v7.1.0/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3
7
+ gem "pg", "~> 1.1"
8
+ end
9
+
10
+ group :mysql do
11
+ # c.f. https://github.com/rails/rails/blob/v7.1.0/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6
12
+ gem "mysql2", "~> 0.5"
13
+ end
14
+
15
+ # TODO: latest activerecord-oracle_enhanced-adapter doesn't support activerecord 7.1
16
+ # group :oracle do
17
+ # gem "activerecord-oracle_enhanced-adapter", "~> 7.0.0"
18
+ # gem "ruby-oci8"
19
+ # end
20
+
21
+ group :sqlite3 do
22
+ # c.f. https://github.com/rails/rails/blob/v7.1.0/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14
23
+ gem "sqlite3", "~> 1.4"
24
+ end
25
+
26
+ eval_gemfile "#{__dir__}/common.gemfile"
27
+
28
+ gemspec path: "../"
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = spec.homepage
18
18
  spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
19
+ spec.metadata["documentation_uri"] = "https://sue445.github.io/index_shotgun/"
19
20
  spec.metadata["rubygems_mfa_required"] = "true"
20
21
 
21
22
  spec.required_ruby_version = ">= 2.4.0"
@@ -29,14 +30,14 @@ Gem::Specification.new do |spec|
29
30
  spec.add_dependency "thor"
30
31
 
31
32
  spec.add_development_dependency "bundler"
32
- spec.add_development_dependency "coveralls"
33
+ spec.add_development_dependency "coveralls_reborn"
33
34
  spec.add_development_dependency "onkcop", "0.53.0.2"
34
35
  spec.add_development_dependency "rake"
35
36
  spec.add_development_dependency "rake_shared_context", "0.2.2"
36
37
  spec.add_development_dependency "rspec"
37
38
  spec.add_development_dependency "rspec-its"
38
- spec.add_development_dependency "rspec-power_assert"
39
39
  spec.add_development_dependency "rubocop", "0.62.0"
40
40
  spec.add_development_dependency "rubocop_auto_corrector"
41
41
  spec.add_development_dependency "simplecov", "< 0.18.0"
42
+ spec.add_development_dependency "yard"
42
43
  end
@@ -21,7 +21,7 @@ module IndexShotgun
21
21
  # @return [IndexShotgun::Analyzer::Response]
22
22
  def perform
23
23
  tables =
24
- ActiveSupport::Deprecation.silence do
24
+ silence_deprecations do
25
25
  ActiveRecord::Base.connection.tables
26
26
  end
27
27
  tables.reject! {|table| exclude_tables.include?(table.downcase) }
@@ -70,7 +70,7 @@ module IndexShotgun
70
70
  # check duplicate indexes of table
71
71
  # @param table [String] table name
72
72
  # @return [Array<Hash>] array of index info
73
- # index: index info {ActiveRecord::ConnectionAdapters::IndexDefinition}
73
+ # index: index info `ActiveRecord::ConnectionAdapters::IndexDefinition`
74
74
  # result: search result message
75
75
  def check_indexes(table)
76
76
  indexes = table_indexes(table)
@@ -94,7 +94,6 @@ module IndexShotgun
94
94
 
95
95
  # get indexes of table
96
96
  # @param table [String]
97
- # @see [ActiveRecord::ConnectionAdapters::TableDefinition#indexes]
98
97
  def table_indexes(table)
99
98
  ActiveRecord::Base.connection.indexes(table)
100
99
  end
@@ -288,6 +287,18 @@ module IndexShotgun
288
287
  @exclude_tables = tables.map(&:downcase)
289
288
  @exclude_tables
290
289
  end
290
+
291
+ def silence_deprecations
292
+ if ActiveSupport.version >= Gem::Version.create("7.1.0")
293
+ ActiveSupport::Deprecation::Deprecators.new.silence do
294
+ yield
295
+ end
296
+ else
297
+ ActiveSupport::Deprecation.silence do
298
+ yield
299
+ end
300
+ end
301
+ end
291
302
  end
292
303
  end
293
304
  end
@@ -1,3 +1,3 @@
1
1
  module IndexShotgun
2
- VERSION = "1.0.1".freeze
2
+ VERSION = "1.0.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: index_shotgun
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-19 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: coveralls
56
+ name: coveralls_reborn
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -136,20 +136,6 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: rspec-power_assert
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: rubocop
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +178,20 @@ dependencies:
192
178
  - - "<"
193
179
  - !ruby/object:Gem::Version
194
180
  version: 0.18.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: yard
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
195
  description: duplicate index checker
196
196
  email:
197
197
  - sue445@sue445.net
@@ -201,11 +201,14 @@ extensions: []
201
201
  extra_rdoc_files: []
202
202
  files:
203
203
  - ".coveralls.yml"
204
+ - ".github/dependabot.yml"
205
+ - ".github/workflows/pages.yml"
204
206
  - ".github/workflows/test.yml"
205
207
  - ".github_changelog_generator"
206
208
  - ".gitignore"
207
209
  - ".rspec"
208
210
  - ".rubocop.yml"
211
+ - ".yardopts"
209
212
  - CHANGELOG.md
210
213
  - Gemfile
211
214
  - LICENSE.txt
@@ -226,6 +229,7 @@ files:
226
229
  - gemfiles/activerecord_6_0.gemfile
227
230
  - gemfiles/activerecord_6_1.gemfile
228
231
  - gemfiles/activerecord_7_0.gemfile
232
+ - gemfiles/activerecord_7_1.gemfile
229
233
  - gemfiles/common.gemfile
230
234
  - index_shotgun.gemspec
231
235
  - lib/index_shotgun.rb
@@ -243,6 +247,7 @@ metadata:
243
247
  homepage_uri: https://github.com/sue445/index_shotgun
244
248
  source_code_uri: https://github.com/sue445/index_shotgun
245
249
  changelog_uri: https://github.com/sue445/index_shotgun/blob/master/CHANGELOG.md
250
+ documentation_uri: https://sue445.github.io/index_shotgun/
246
251
  rubygems_mfa_required: 'true'
247
252
  post_install_message:
248
253
  rdoc_options: []
@@ -259,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
264
  - !ruby/object:Gem::Version
260
265
  version: '0'
261
266
  requirements: []
262
- rubygems_version: 3.2.22
267
+ rubygems_version: 3.5.3
263
268
  signing_key:
264
269
  specification_version: 4
265
270
  summary: duplicate index checker