Skip to content

Commit c2ca78f

Browse files
committed
chore(misc): auto-correct rubocop offenses in misc files
Applied rubocop auto-corrections to: - bin/ scripts - lib/tasks - scripts/ - Gemfile, .gitignore
1 parent 53696bd commit c2ca78f

8 files changed

Lines changed: 704 additions & 694 deletions

File tree

Gemfile

Lines changed: 102 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,102 @@
1-
source "https://rubygems.org"
2-
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3-
4-
ruby "3.4.5"
5-
6-
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7-
gem "rails", "~> 7.2.0"
8-
9-
# Use postgresql as the database for Active Record
10-
gem "pg", "~> 1.1"
11-
12-
# Use the Puma web server [https://github.com/puma/puma]
13-
gem "puma", "~> 6.0"
14-
15-
# Security: Force Rack to safe version to fix CVE-2025-61780 and CVE-2025-61919
16-
gem "rack", "~> 3.1.18"
17-
18-
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
19-
# gem "jbuilder"
20-
21-
# Use Redis adapter to run Action Cable in production
22-
gem "redis", "~> 5.0"
23-
24-
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
25-
# gem "kredis"
26-
27-
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
28-
gem "bcrypt", "~> 3.1.7"
29-
30-
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
31-
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
32-
33-
# Reduces boot times through caching; required in config/boot.rb
34-
gem "bootsnap", require: false
35-
36-
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
37-
# gem "image_processing", "~> 1.2"
38-
39-
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
40-
gem "rack-cors"
41-
42-
# JWT for authentication
43-
gem "jwt"
44-
45-
# Serializers for API responses
46-
gem "blueprinter"
47-
48-
# Background jobs
49-
gem "sidekiq", "~> 7.0"
50-
gem "sidekiq-scheduler"
51-
52-
# Environment variables
53-
gem "dotenv-rails"
54-
55-
# HTTP client for Riot API
56-
gem "faraday"
57-
gem "faraday-retry"
58-
59-
# Authorization
60-
gem "pundit"
61-
62-
# Rate limiting
63-
gem "rack-attack"
64-
65-
# UUID generation
66-
gem "securerandom"
67-
68-
# Pagination
69-
gem "kaminari"
70-
71-
# API documentation
72-
gem "rswag"
73-
gem "rswag-api"
74-
gem "rswag-ui"
75-
76-
group :development, :test do
77-
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
78-
gem "debug", platforms: %i[ mri mingw x64_mingw ]
79-
gem "rspec-rails"
80-
gem "factory_bot_rails"
81-
gem "faker"
82-
gem "rswag-specs"
83-
end
84-
85-
group :development do
86-
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
87-
# gem "spring"
88-
gem "annotate"
89-
gem "rubocop"
90-
gem "rubocop-rails"
91-
gem "rubocop-rspec"
92-
end
93-
94-
group :test do
95-
gem "shoulda-matchers"
96-
gem "database_cleaner-active_record"
97-
gem "webmock"
98-
gem "vcr"
99-
gem "simplecov", require: false
100-
end
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5+
6+
ruby '3.4.5'
7+
8+
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
9+
gem 'rails', '~> 7.2.0'
10+
11+
# Use postgresql as the database for Active Record
12+
gem 'pg', '~> 1.1'
13+
14+
# Use the Puma web server [https://github.com/puma/puma]
15+
gem 'puma', '~> 6.0'
16+
17+
# Security: Force Rack to safe version to fix CVE-2025-61780 and CVE-2025-61919
18+
gem 'rack', '~> 3.1.18'
19+
20+
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
21+
# gem "jbuilder"
22+
23+
# Use Redis adapter to run Action Cable in production
24+
gem 'redis', '~> 5.0'
25+
26+
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
27+
# gem "kredis"
28+
29+
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
30+
gem 'bcrypt', '~> 3.1.7'
31+
32+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
33+
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
34+
35+
# Reduces boot times through caching; required in config/boot.rb
36+
gem 'bootsnap', require: false
37+
38+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
39+
# gem "image_processing", "~> 1.2"
40+
41+
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
42+
gem 'rack-cors'
43+
44+
# JWT for authentication
45+
gem 'jwt'
46+
47+
# Serializers for API responses
48+
gem 'blueprinter'
49+
50+
# Background jobs
51+
gem 'sidekiq', '~> 7.0'
52+
gem 'sidekiq-scheduler'
53+
54+
# Environment variables
55+
gem 'dotenv-rails'
56+
57+
# HTTP client for Riot API
58+
gem 'faraday'
59+
gem 'faraday-retry'
60+
61+
# Authorization
62+
gem 'pundit'
63+
64+
# Rate limiting
65+
gem 'rack-attack'
66+
67+
# UUID generation
68+
gem 'securerandom'
69+
70+
# Pagination
71+
gem 'kaminari'
72+
73+
# API documentation
74+
gem 'rswag'
75+
gem 'rswag-api'
76+
gem 'rswag-ui'
77+
78+
group :development, :test do
79+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
80+
gem 'debug', platforms: %i[mri mingw x64_mingw]
81+
gem 'factory_bot_rails'
82+
gem 'faker'
83+
gem 'rspec-rails'
84+
gem 'rswag-specs'
85+
end
86+
87+
group :development do
88+
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
89+
# gem "spring"
90+
gem 'annotate'
91+
gem 'rubocop'
92+
gem 'rubocop-rails'
93+
gem 'rubocop-rspec'
94+
end
95+
96+
group :test do
97+
gem 'database_cleaner-active_record'
98+
gem 'shoulda-matchers'
99+
gem 'simplecov', require: false
100+
gem 'vcr'
101+
gem 'webmock'
102+
end

bin/rails

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
APP_PATH = File.expand_path('../config/application', __dir__)
35
require_relative '../config/boot'
46
require 'rails/commands'

bin/rake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
require_relative '../config/boot'
35
require 'rake'
46
Rake.application.run

bin/setup

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
require 'fileutils'
35

46
# path to your application root.

lib/tasks/db_fix.rake

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
1-
namespace :db do
2-
desc "Mark all migrations as applied"
3-
task mark_migrations_up: :environment do
4-
versions = %w[
5-
20241001000002
6-
20241001000003
7-
20241001000004
8-
20241001000005
9-
20241001000006
10-
20241001000007
11-
20241001000008
12-
20241001000009
13-
20241001000010
14-
20241001000011
15-
20241001000012
16-
20241001000013
17-
20241001000014
18-
]
19-
20-
versions.each do |version|
21-
ActiveRecord::Base.connection.execute(
22-
"INSERT INTO schema_migrations (version) VALUES ('#{version}') ON CONFLICT DO NOTHING"
23-
)
24-
end
25-
26-
puts "✅ All migrations marked as up!"
27-
end
28-
29-
desc "Reset public schema tables"
30-
task reset_public_schema: :environment do
31-
puts "🗑️ Dropping all tables in public schema..."
32-
33-
tables = ActiveRecord::Base.connection.execute(<<-SQL
34-
SELECT tablename FROM pg_tables WHERE schemaname = 'public'
35-
SQL
36-
).map { |row| row['tablename'] }
37-
38-
tables.each do |table|
39-
next if table == 'schema_migrations' || table == 'ar_internal_metadata'
40-
41-
puts " Dropping #{table}..."
42-
ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS #{table} CASCADE")
43-
end
44-
45-
# Clear schema_migrations
46-
ActiveRecord::Base.connection.execute("DELETE FROM schema_migrations")
47-
48-
puts "✅ Public schema reset complete!"
49-
end
50-
end
1+
# frozen_string_literal: true
2+
3+
namespace :db do
4+
desc 'Mark all migrations as applied'
5+
task mark_migrations_up: :environment do
6+
versions = %w[
7+
20241001000002
8+
20241001000003
9+
20241001000004
10+
20241001000005
11+
20241001000006
12+
20241001000007
13+
20241001000008
14+
20241001000009
15+
20241001000010
16+
20241001000011
17+
20241001000012
18+
20241001000013
19+
20241001000014
20+
]
21+
22+
versions.each do |version|
23+
ActiveRecord::Base.connection.execute(
24+
"INSERT INTO schema_migrations (version) VALUES ('#{version}') ON CONFLICT DO NOTHING"
25+
)
26+
end
27+
28+
puts '✅ All migrations marked as up!'
29+
end
30+
31+
desc 'Reset public schema tables'
32+
task reset_public_schema: :environment do
33+
puts '🗑️ Dropping all tables in public schema...'
34+
35+
tables = ActiveRecord::Base.connection.execute(<<-SQL
36+
SELECT tablename FROM pg_tables WHERE schemaname = 'public'
37+
SQL
38+
).map { |row| row['tablename'] }
39+
40+
tables.each do |table|
41+
next if %w[schema_migrations ar_internal_metadata].include?(table)
42+
43+
puts " Dropping #{table}..."
44+
ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS #{table} CASCADE")
45+
end
46+
47+
# Clear schema_migrations
48+
ActiveRecord::Base.connection.execute('DELETE FROM schema_migrations')
49+
50+
puts '✅ Public schema reset complete!'
51+
end
52+
end

0 commit comments

Comments
 (0)