Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# Omakase Ruby styling for Rails
inherit_gem: { rubocop-rails-omakase: rubocop.yml }

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Include:
- "app/**/*"
- "config/**/*"
- "lib/**/*"
- "spec/**/*"
- "Gemfile"
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Include:
- "app/**/*"
- "config/**/*"
- "lib/**/*"
- "spec/**/*"
- "Gemfile"
Bundler/OrderedGems:
Enabled: true

# Overwrite or add rules to create your own house style
#
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ gem "tailwindcss-rails"
gem "tzinfo-data", platforms: %i[ windows jruby ]

# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
gem "solid_cable"
gem "solid_cache"
gem "solid_queue"
gem "solid_cable"

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
Expand Down
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ GEM
ffi (1.17.3-aarch64-linux-musl)
ffi (1.17.3-arm-linux-gnu)
ffi (1.17.3-arm-linux-musl)
ffi (1.17.3-arm64-darwin)
ffi (1.17.3-x86_64-linux-gnu)
ffi (1.17.3-x86_64-linux-musl)
fugit (1.12.1)
Expand Down Expand Up @@ -200,6 +201,8 @@ GEM
racc (~> 1.4)
nokogiri (1.19.0-arm-linux-musl)
racc (~> 1.4)
nokogiri (1.19.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.19.0-x86_64-linux-gnu)
racc (~> 1.4)
nokogiri (1.19.0-x86_64-linux-musl)
Expand Down Expand Up @@ -350,6 +353,7 @@ GEM
sqlite3 (2.9.0-aarch64-linux-musl)
sqlite3 (2.9.0-arm-linux-gnu)
sqlite3 (2.9.0-arm-linux-musl)
sqlite3 (2.9.0-arm64-darwin)
sqlite3 (2.9.0-x86_64-linux-gnu)
sqlite3 (2.9.0-x86_64-linux-musl)
sshkit (1.25.0)
Expand All @@ -368,11 +372,13 @@ GEM
tailwindcss-ruby (4.1.18)
tailwindcss-ruby (4.1.18-aarch64-linux-gnu)
tailwindcss-ruby (4.1.18-aarch64-linux-musl)
tailwindcss-ruby (4.1.18-arm64-darwin)
tailwindcss-ruby (4.1.18-x86_64-linux-gnu)
tailwindcss-ruby (4.1.18-x86_64-linux-musl)
thor (1.5.0)
thruster (0.1.18)
thruster (0.1.18-aarch64-linux)
thruster (0.1.18-arm64-darwin)
thruster (0.1.18-x86_64-linux)
timeout (0.6.0)
tsort (0.2.0)
Expand Down Expand Up @@ -406,6 +412,7 @@ PLATFORMS
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin-25
x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl
Expand Down Expand Up @@ -481,6 +488,7 @@ CHECKSUMS
ffi (1.17.3-aarch64-linux-musl) sha256=020b33b76775b1abacc3b7d86b287cef3251f66d747092deec592c7f5df764b2
ffi (1.17.3-arm-linux-gnu) sha256=5bd4cea83b68b5ec0037f99c57d5ce2dd5aa438f35decc5ef68a7d085c785668
ffi (1.17.3-arm-linux-musl) sha256=0d7626bb96265f9af78afa33e267d71cfef9d9a8eb8f5525344f8da6c7d76053
ffi (1.17.3-arm64-darwin) sha256=0c690555d4cee17a7f07c04d59df39b2fba74ec440b19da1f685c6579bb0717f
ffi (1.17.3-x86_64-linux-gnu) sha256=3746b01f677aae7b16dc1acb7cb3cc17b3e35bdae7676a3f568153fb0e2c887f
ffi (1.17.3-x86_64-linux-musl) sha256=086b221c3a68320b7564066f46fed23449a44f7a1935f1fe5a245bd89d9aea56
fugit (1.12.1) sha256=5898f478ede9b415f0804e42b8f3fd53f814bd85eebffceebdbc34e1107aaf68
Expand Down Expand Up @@ -515,6 +523,7 @@ CHECKSUMS
nokogiri (1.19.0-aarch64-linux-musl) sha256=eb70507f5e01bc23dad9b8dbec2b36ad0e61d227b42d292835020ff754fb7ba9
nokogiri (1.19.0-arm-linux-gnu) sha256=572a259026b2c8b7c161fdb6469fa2d0edd2b61cd599db4bbda93289abefbfe5
nokogiri (1.19.0-arm-linux-musl) sha256=23ed90922f1a38aed555d3de4d058e90850c731c5b756d191b3dc8055948e73c
nokogiri (1.19.0-arm64-darwin) sha256=0811dfd936d5f6dd3f6d32ef790568bf29b2b7bead9ba68866847b33c9cf5810
nokogiri (1.19.0-x86_64-linux-gnu) sha256=f482b95c713d60031d48c44ce14562f8d2ce31e3a9e8dd0ccb131e9e5a68b58c
nokogiri (1.19.0-x86_64-linux-musl) sha256=1c4ca6b381622420073ce6043443af1d321e8ed93cc18b08e2666e5bd02ffae4
ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
Expand Down Expand Up @@ -565,6 +574,7 @@ CHECKSUMS
sqlite3 (2.9.0-aarch64-linux-musl) sha256=56a35cb2d70779afc2ac191baf2c2148242285ecfed72f9b021218c5c4917913
sqlite3 (2.9.0-arm-linux-gnu) sha256=a19a21504b0d7c8c825fbbf37b358ae316b6bd0d0134c619874060b2eef05435
sqlite3 (2.9.0-arm-linux-musl) sha256=fca5b26197c70e3363115d3faaea34d7b2ad9c7f5fa8d8312e31b64e7556ee07
sqlite3 (2.9.0-arm64-darwin) sha256=a917bd9b84285766ff3300b7d79cd583f5a067594c8c1263e6441618c04a6ed3
sqlite3 (2.9.0-x86_64-linux-gnu) sha256=72fff9bd750070ba3af695511ba5f0e0a2d8a9206f84869640b3e99dfaf3d5a5
sqlite3 (2.9.0-x86_64-linux-musl) sha256=ef716ba7a66d7deb1ccc402ac3a6d7343da17fac862793b7f0be3d2917253c90
sshkit (1.25.0) sha256=c8c6543cdb60f91f1d277306d585dd11b6a064cb44eab0972827e4311ff96744
Expand All @@ -574,11 +584,13 @@ CHECKSUMS
tailwindcss-ruby (4.1.18) sha256=b62fad5b00494e92987ee319dfb5c5ad272f0ed93649963d62f08d2ba0f03fa7
tailwindcss-ruby (4.1.18-aarch64-linux-gnu) sha256=e10f9560bccddbb4955fd535b3bcc8c7071a7df07404dd473a23fa791ec4e46b
tailwindcss-ruby (4.1.18-aarch64-linux-musl) sha256=3c8426674718a2c98a0649c825ac0b3286ff52acd0b4052d7d19126cd74904f3
tailwindcss-ruby (4.1.18-arm64-darwin) sha256=f940531d5a030c566d3d616004235bcd4c361abdd328f7d6c7e3a953a32e0155
tailwindcss-ruby (4.1.18-x86_64-linux-gnu) sha256=e0a2220163246fe0126c5c5bafb95bc6206e7d21fce2a2878fd9c9a359137534
tailwindcss-ruby (4.1.18-x86_64-linux-musl) sha256=d957cf545b09d2db7eb6267450cc1fc589e126524066537a0c4d5b99d701f4b2
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
thruster (0.1.18) sha256=f025103bc7c8e6747436bb9de058c366840d2871560574ea7070a9bc8608a889
thruster (0.1.18-aarch64-linux) sha256=16f3d49468d76a9a5de86b7bdedf535b7b80da7c16495ca8ec96cfdc256870e2
thruster (0.1.18-arm64-darwin) sha256=8b297797a354ec6a81ea156b44279b66bff8da2404112f70f4ec515c2f276cc2
thruster (0.1.18-x86_64-linux) sha256=0ec1ff5f12289c1ac10cf8e28ce6b5266f4e73416b34a664b79d037c7d955c40
timeout (0.6.0) sha256=6d722ad619f96ee383a0c557ec6eb8c4ecb08af3af62098a0be5057bf00de1af
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
Expand Down
2 changes: 1 addition & 1 deletion app/services/admins_xml_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def parse
first_name: node.at_xpath("USER_FNAME")&.text&.strip,
last_name: node.at_xpath("USER_LNAME")&.text&.strip,
login_id: node.at_xpath("USER_ID")&.text&.strip&.downcase,
legacy_password_hash: node.at_xpath("PASSWORD")&.text&.strip
legacy_password_hash: node.at_xpath("PASSWORD")&.text&.strip,
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/services/content_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def import
files: { created: 0 },
authors: { created: 0 },
tags: { created: 0 },
errors: []
errors: [],
}

parsed_content.each do |provider_data|
Expand Down
4 changes: 2 additions & 2 deletions app/services/content_xml_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def parse_topics(provider_node)
issue: title_node.at_xpath("topic_issue")&.text&.strip,
files: parse_files(title_node),
authors: parse_authors(title_node),
tags: parse_tags(title_node)
tags: parse_tags(title_node),
}
end

Expand All @@ -57,7 +57,7 @@ def parse_files(title_node)
files << {
filename: filename,
file_size: file_node["file_size"]&.to_i,
file_type: determine_file_type(filename)
file_type: determine_file_type(filename),
}
end

Expand Down
8 changes: 4 additions & 4 deletions app/services/stats_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def overview
total_authors: Author.count,
total_tags: Tag.count,
total_favorites: Favorite.count,
total_local_files: LocalFile.count
total_local_files: LocalFile.count,
}
end

Expand All @@ -28,7 +28,7 @@ def activity_summary
searches: base_query.searches.count,
favorites: base_query.favorites.count,
unfavorites: base_query.unfavorites.count,
unique_users: base_query.distinct.count(:user_id)
unique_users: base_query.distinct.count(:user_id),
}
end

Expand Down Expand Up @@ -146,7 +146,7 @@ def group_by_day(relation, column)
# No string interpolation - each column has a literal SQL expression
DATE_SQL_EXPRESSIONS = {
"created_at" => Arel.sql("DATE(created_at)"),
"updated_at" => Arel.sql("DATE(updated_at)")
"updated_at" => Arel.sql("DATE(updated_at)"),
}.freeze

def date_sql_for_column(column)
Expand All @@ -162,7 +162,7 @@ module GroupByDayExtension
# Pre-defined SQL expressions for allowed columns (no interpolation)
DATE_SQL_EXPRESSIONS = {
"created_at" => Arel.sql("DATE(created_at)"),
"updated_at" => Arel.sql("DATE(updated_at)")
"updated_at" => Arel.sql("DATE(updated_at)"),
}.freeze

def group_by_day(column)
Expand Down
2 changes: 1 addition & 1 deletion app/services/users_xml_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def parse
last_name: node.at_xpath("USER_LNAME")&.text&.strip,
login_id: node.at_xpath("USER_ID")&.text&.strip&.downcase,
login_count: node.at_xpath("LOGIN_COUNTER")&.text&.to_i || 0,
favorites: parse_favorites(node.at_xpath("FAVOURITE")&.text)
favorites: parse_favorites(node.at_xpath("FAVOURITE")&.text),
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc,
]
2 changes: 1 addition & 1 deletion spec/helpers/admin/base_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the Admin::BaseHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/admin/dashboard_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the Admin::DashboardHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/admin/sessions_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the Admin::SessionsHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/audio_player_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the AudioPlayerHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/errors_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the ErrorsHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/pdf_viewer_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the PdfViewerHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/registrations_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the RegistrationsHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/search_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the SearchHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/sessions_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the SessionsHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/topics_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

# Specs in this file have access to a helper object that includes
# the TopicsHelper. For example:
Expand Down
2 changes: 1 addition & 1 deletion spec/models/admin_activity_log_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe AdminActivityLog, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/admin_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe Admin, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/author_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe Author, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/content_provider_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe ContentProvider, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/local_file_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe LocalFile, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/tag_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe Tag, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/topic_author_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe TopicAuthor, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/topic_file_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe TopicFile, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/topic_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe Topic, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/topic_tag_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe TopicTag, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/user_activity_log_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe UserActivityLog, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe User, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
10 changes: 5 additions & 5 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require "spec_helper"
ENV["RAILS_ENV"] ||= "test"
require_relative "../config/environment"
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
# Uncomment the line below in case you have `--require rails_helper` in the `.rspec` file
# that will avoid rails generators crashing because migrations haven't been run yet
# return unless Rails.env.test?
require 'rspec/rails'
require "rspec/rails"
# Add additional requires below this line. Rails is not loaded until this point!

# Requires supporting ruby files with custom matchers and macros, etc, in
Expand Down Expand Up @@ -40,7 +40,7 @@

# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_paths = [
Rails.root.join('spec/fixtures')
Rails.root.join("spec/fixtures"),
]

# If you're not using ActiveRecord, or you'd prefer not to run each of your
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/admin/base_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe "Admin::Bases", type: :request do
describe "GET /index" do
Expand Down
2 changes: 1 addition & 1 deletion spec/views/admin/dashboard/index.html.tailwindcss_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe "dashboard/index.html.tailwindcss", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/views/admin/sessions/create.html.tailwindcss_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe "sessions/create.html.tailwindcss", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
2 changes: 1 addition & 1 deletion spec/views/admin/sessions/destroy.html.tailwindcss_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe "sessions/destroy.html.tailwindcss", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
Expand Down
Loading