style: rubocop

This commit is contained in:
Neetpone 2024-07-30 09:56:47 -04:00
parent 14f2591c1c
commit efa9d065e3
9 changed files with 32 additions and 22 deletions

View file

@ -48,7 +48,7 @@ Style/ClassVars:
Style/ClassAndModuleChildren: Style/ClassAndModuleChildren:
EnforcedStyle: compact EnforcedStyle: compact
# This does the oppposite of what I want to do. # This does the opposite of what I want to do.
Layout/HashAlignment: Layout/HashAlignment:
Enabled: false Enabled: false
@ -60,4 +60,8 @@ Style/NumericPredicate:
# I've always been an "unnecessary this->" guy myself. # I've always been an "unnecessary this->" guy myself.
Style/RedundantSelf: Style/RedundantSelf:
Enabled: false
# Story downloads rely on this.
Rails/RenderInline:
Enabled: false Enabled: false

View file

@ -15,8 +15,7 @@ class ImagesController < ApplicationController
ext = File.extname(url) ext = File.extname(url)
hash = Digest::SHA256.hexdigest(url) hash = Digest::SHA256.hexdigest(url)
path = Rails.root.join('public', 'cached-images', hash + ext) path = Rails.public_path.join('cached-images', hash + ext)
our_url = "/cached-images/#{hash}#{ext}"
content_type = nil content_type = nil
if File.exist? path if File.exist? path

View file

@ -70,12 +70,12 @@ class SearchController < ApplicationController
# returns: [included tags, excluded tags] # returns: [included tags, excluded tags]
def parse_tag_queries def parse_tag_queries
tag_searches = "#{@search_params[:tags]},#{@search_params[:characters]}".split(',').reject(&:blank?) tag_searches = "#{@search_params[:tags]},#{@search_params[:characters]}".split(',').compact_blank
[ [
tag_searches.reject { |t| t[0] == '-' }, tag_searches.reject { |t| t[0] == '-' },
tag_searches.select { |t| t[0] == '-' } tag_searches.select { |t| t[0] == '-' }
.map { |t| t[1..] } .pluck(1..)
] ]
end end

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
# == Schema Information # == Schema Information
# #
# Table name: visit_counts # Table name: visit_counts

View file

@ -41,7 +41,7 @@ m = Module.new do
def gemfile def gemfile
gemfile = ENV['BUNDLE_GEMFILE'] gemfile = ENV['BUNDLE_GEMFILE']
return gemfile if gemfile && !gemfile.empty? return gemfile if gemfile.present?
File.expand_path('../Gemfile', __dir__) File.expand_path('../Gemfile', __dir__)
end end

View file

@ -26,17 +26,22 @@ Bundler.require(*Rails.groups)
# #
# config.time_zone = "Central Time (US & Canada)" # config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras") # config.eager_load_paths << Rails.root.join("extras")
module Foalfetch # Configuration for the application, engines, and railties goes here.
class Application < Rails::Application #
# Initialize configuration defaults for originally generated Rails version. # These settings can be overridden in specific environments using the files
config.load_defaults 7.0 # in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
class Foalfetch::Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
# Configuration for the application, engines, and railties goes here. # Configuration for the application, engines, and railties goes here.
# #
# These settings can be overridden in specific environments using the files # These settings can be overridden in specific environments using the files
# in config/environments, which are processed later. # in config/environments, which are processed later.
# #
# config.time_zone = "Central Time (US & Canada)" # config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras") # config.eager_load_paths << Rails.root.join("extras")
end end
end

View file

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "test_helper" require 'test_helper'
class BlogsControllerTest < ActionDispatch::IntegrationTest class BlogsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do # test "the truth" do

View file

@ -9,7 +9,7 @@
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# #
require "test_helper" require 'test_helper'
class BlogTest < ActiveSupport::TestCase class BlogTest < ActiveSupport::TestCase
# test "the truth" do # test "the truth" do

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
# == Schema Information # == Schema Information
# #
# Table name: visit_counts # Table name: visit_counts
@ -6,7 +7,7 @@
# count :integer default(0), not null # count :integer default(0), not null
# date :date not null # date :date not null
# #
require "test_helper" require 'test_helper'
class VisitCountTest < ActiveSupport::TestCase class VisitCountTest < ActiveSupport::TestCase
# test "the truth" do # test "the truth" do