diff --git a/.rubocop.yml b/.rubocop.yml index c7217ec3..3d8c86a4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -69,6 +69,9 @@ Style/Documentation: Style/EmptyMethod: EnforcedStyle: expanded +Style/FrozenStringLiteralComment: + EnforcedStyle: never + Style/HashSyntax: EnforcedShorthandSyntax: never diff --git a/Dockerfile b/Dockerfile index 8a4deb3a..89b2846f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,7 @@ RUN apk --no-cache add \ ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2 ENV RUBY_YJIT_ENABLE=1 +ENV RUBYOPT=--enable=frozen-string-literal RUN echo "[safe]" > ~/.gitconfig && \ echo " directory = /app" >> ~/.gitconfig diff --git a/Gemfile b/Gemfile index 86eecc44..3bb962e1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,3 @@ -# frozen_string_literal: true - source "https://rubygems.org" rails_version = "~> 7.0" diff --git a/Rakefile b/Rakefile index d2a78aa2..9a5ea738 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0eb745b2..9927ddb2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ApplicationController < ActionController::Base skip_forgery_protection before_action :set_start_time diff --git a/app/controllers/archive_imports_controller.rb b/app/controllers/archive_imports_controller.rb index 185b68be..05954e9b 100644 --- a/app/controllers/archive_imports_controller.rb +++ b/app/controllers/archive_imports_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ArchiveImportsController < ApplicationController def new end diff --git a/app/controllers/artist_urls_controller.rb b/app/controllers/artist_urls_controller.rb index 878bfe84..a43be517 100644 --- a/app/controllers/artist_urls_controller.rb +++ b/app/controllers/artist_urls_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ArtistUrlsController < ApplicationController def index @pagy, @artist_urls = ArtistUrl.search(index_search_params).pagy(params) diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 7c9a3e65..58b27616 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ArtistsController < ApplicationController def index @pagy, @artists = Artist.includes(:artist_urls).search(index_search_params).pagy(params) diff --git a/app/controllers/config_controller.rb b/app/controllers/config_controller.rb index 3cc2073f..84414be5 100644 --- a/app/controllers/config_controller.rb +++ b/app/controllers/config_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ConfigController < ApplicationController def index end diff --git a/app/controllers/iqdb_controller.rb b/app/controllers/iqdb_controller.rb index 3047c434..6974b61b 100644 --- a/app/controllers/iqdb_controller.rb +++ b/app/controllers/iqdb_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class IqdbController < ApplicationController def index end diff --git a/app/controllers/log_events_controller.rb b/app/controllers/log_events_controller.rb index 54f162bd..eb124ffc 100644 --- a/app/controllers/log_events_controller.rb +++ b/app/controllers/log_events_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class LogEventsController < ApplicationController def index @pagy, @log_events = LogEvent.search(search_params).pagy_and_decorate(params) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 26025ba3..0ed542d5 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class StatsController < ApplicationController def index @original_size = sum_for("original", "SubmissionFile") diff --git a/app/controllers/submission_files_controller.rb b/app/controllers/submission_files_controller.rb index d6c6c899..b99b30f9 100644 --- a/app/controllers/submission_files_controller.rb +++ b/app/controllers/submission_files_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class SubmissionFilesController < ApplicationController def index @search_params = search_params diff --git a/app/decorators/application_decorator.rb b/app/decorators/application_decorator.rb index 2b6b9af0..54190491 100644 --- a/app/decorators/application_decorator.rb +++ b/app/decorators/application_decorator.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ApplicationDecorator include ActiveModel::Serialization include ActiveModel::Serializers::JSON diff --git a/app/decorators/log_event_decorator.rb b/app/decorators/log_event_decorator.rb index 6b340c44..60a5388d 100644 --- a/app/decorators/log_event_decorator.rb +++ b/app/decorators/log_event_decorator.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class LogEventDecorator < ApplicationDecorator def preview case action diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 90434e5a..214d6c90 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module ApplicationHelper include Pagy::Frontend diff --git a/app/helpers/artist_helper.rb b/app/helpers/artist_helper.rb index a5e85ecf..2c3471f0 100644 --- a/app/helpers/artist_helper.rb +++ b/app/helpers/artist_helper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module ArtistHelper def active_artist_urls_collection(artist) scraping_enabled = artist.artist_urls.select(&:scraper?) diff --git a/app/helpers/artist_url_helper.rb b/app/helpers/artist_url_helper.rb index 2e1c196e..0bb604c1 100644 --- a/app/helpers/artist_url_helper.rb +++ b/app/helpers/artist_url_helper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module ArtistUrlHelper def gallery_url(artist_url) artist_url.site.gallery_url(artist_url.unescaped_url_identifier) diff --git a/app/helpers/config_helper.rb b/app/helpers/config_helper.rb index e4a42638..13df8e82 100644 --- a/app/helpers/config_helper.rb +++ b/app/helpers/config_helper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module ConfigHelper def strip_config_prefix(definition, key) key.to_s.delete_prefix("#{definition.site_type}_") diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index f707f02a..46af549b 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module NavHelper def nav_link_to(text, url, **) link = link_to(text, url, class: nav_link_class(url), **) diff --git a/app/helpers/submission_file_helper.rb b/app/helpers/submission_file_helper.rb index 9ee0c5c2..39bc1d7b 100644 --- a/app/helpers/submission_file_helper.rb +++ b/app/helpers/submission_file_helper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module SubmissionFileHelper def display_artist_name?(submission_file) s1 = submission_file.artist_url.url_identifier.downcase diff --git a/app/inputs/boolean_input.rb b/app/inputs/boolean_input.rb index a1734682..faa99119 100644 --- a/app/inputs/boolean_input.rb +++ b/app/inputs/boolean_input.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class BooleanInput < SimpleForm::Inputs::BooleanInput # Fix styling because the input appears before the label def label_input(wrapper_options = nil) diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index 81271a1c..78b86e8c 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ApplicationJob < ActiveJob::Base retry_on StandardError, wait: :polynomially_longer, attempts: 25 do |_job, exception| log_exception(exception) diff --git a/app/jobs/archive_blob_import_job.rb b/app/jobs/archive_blob_import_job.rb index 24b75e1f..db72e128 100644 --- a/app/jobs/archive_blob_import_job.rb +++ b/app/jobs/archive_blob_import_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ArchiveBlobImportJob < ConcurrencyControlledJob queue_as :submission_download retry_on StandardError, attempts: 5 diff --git a/app/jobs/concurrency_controlled_job.rb b/app/jobs/concurrency_controlled_job.rb index 6d2cb7b5..659cd1f7 100644 --- a/app/jobs/concurrency_controlled_job.rb +++ b/app/jobs/concurrency_controlled_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ConcurrencyControlledJob < ApplicationJob include GoodJob::ActiveJobExtensions::Concurrency # Automatically scope keys to the job/queue. diff --git a/app/jobs/create_submission_file_job.rb b/app/jobs/create_submission_file_job.rb index 2d787183..6299e0d9 100644 --- a/app/jobs/create_submission_file_job.rb +++ b/app/jobs/create_submission_file_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateSubmissionFileJob < ConcurrencyControlledJob queue_as :submission_download good_job_control_concurrency_with(total_limit: 1, key: -> { "#{arguments.first.id}-#{arguments.second[:identifier]}" }) diff --git a/app/jobs/e6_iqdb_query_job.rb b/app/jobs/e6_iqdb_query_job.rb index 0550f874..4b4c50cd 100644 --- a/app/jobs/e6_iqdb_query_job.rb +++ b/app/jobs/e6_iqdb_query_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class E6IqdbQueryJob < ConcurrencyControlledJob queue_as :e6_iqdb good_job_control_concurrency_with(total_limit: 1, key: -> { arguments.first.id }) diff --git a/app/jobs/purge_log_events_job.rb b/app/jobs/purge_log_events_job.rb index 6d16b9da..d6d9d2b8 100644 --- a/app/jobs/purge_log_events_job.rb +++ b/app/jobs/purge_log_events_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class PurgeLogEventsJob < ApplicationJob def perform LogEvent.where(created_at: ..1.month.ago).delete_all diff --git a/app/jobs/purge_unattached_blobs_job.rb b/app/jobs/purge_unattached_blobs_job.rb index bb334acd..7e2675eb 100644 --- a/app/jobs/purge_unattached_blobs_job.rb +++ b/app/jobs/purge_unattached_blobs_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class PurgeUnattachedBlobsJob < ApplicationJob def perform ActiveStorage::Blob.unattached.where(created_at: ..2.days.ago).find_each(&:purge) diff --git a/app/jobs/scrape_artist_url_job.rb b/app/jobs/scrape_artist_url_job.rb index 82e69523..7c3708a1 100644 --- a/app/jobs/scrape_artist_url_job.rb +++ b/app/jobs/scrape_artist_url_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ScrapeArtistUrlJob < ConcurrencyControlledJob queue_as :scraping good_job_control_concurrency_with(total_limit: 1, key: -> { arguments.first.id }) diff --git a/app/jobs/submission_file_update_job.rb b/app/jobs/submission_file_update_job.rb index cc841f64..bd590519 100644 --- a/app/jobs/submission_file_update_job.rb +++ b/app/jobs/submission_file_update_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class SubmissionFileUpdateJob < ApplicationJob queue_as :variant_generation diff --git a/app/jobs/update_matching_e6_posts_job.rb b/app/jobs/update_matching_e6_posts_job.rb index e6092e1f..2ce7f438 100644 --- a/app/jobs/update_matching_e6_posts_job.rb +++ b/app/jobs/update_matching_e6_posts_job.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class UpdateMatchingE6PostsJob < ConcurrencyControlledJob good_job_control_concurrency_with(total_limit: 1, key: -> { arguments.first.to_s }) diff --git a/app/logical/archives.rb b/app/logical/archives.rb index f88441fb..100e8fd6 100644 --- a/app/logical/archives.rb +++ b/app/logical/archives.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Archives ALL = [ Archives::Tumblr, diff --git a/app/logical/archives/base.rb b/app/logical/archives/base.rb index 53fa044e..e326bd56 100644 --- a/app/logical/archives/base.rb +++ b/app/logical/archives/base.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Archives class Base attr_accessor :imported_files, :already_imported_count, :failed_imports, :error diff --git a/app/logical/archives/manual.rb b/app/logical/archives/manual.rb index 364f0b2a..b3a9927e 100644 --- a/app/logical/archives/manual.rb +++ b/app/logical/archives/manual.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Archives class Manual < Base def import_submission_files(artist_id, source_url) diff --git a/app/logical/archives/tumblr.rb b/app/logical/archives/tumblr.rb index 4853de9d..801d40b9 100644 --- a/app/logical/archives/tumblr.rb +++ b/app/logical/archives/tumblr.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Archives # Archive Structure # diff --git a/app/logical/config.rb b/app/logical/config.rb index 377e802b..14bf778c 100644 --- a/app/logical/config.rb +++ b/app/logical/config.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Config module_function diff --git a/app/logical/docker_env.rb b/app/logical/docker_env.rb index b8c877e6..2e9a12a2 100644 --- a/app/logical/docker_env.rb +++ b/app/logical/docker_env.rb @@ -1,7 +1,5 @@ -# frozen_string_literal: true - module DockerEnv - NEEDED_PG_VERSION = "16" + NEEDED_PG_VERSION = "16".freeze module_function diff --git a/app/logical/e6_api_client.rb b/app/logical/e6_api_client.rb index d8bc684b..e5a9b613 100644 --- a/app/logical/e6_api_client.rb +++ b/app/logical/e6_api_client.rb @@ -1,7 +1,5 @@ -# frozen_string_literal: true - module E6ApiClient - ORIGIN = "https://e621.net" + ORIGIN = "https://e621.net".freeze extend self def iqdb_query(file) diff --git a/app/logical/esbuild_manifest.rb b/app/logical/esbuild_manifest.rb index 481dfb83..8d36a59d 100644 --- a/app/logical/esbuild_manifest.rb +++ b/app/logical/esbuild_manifest.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module EsbuildManifest FILE_LOCATION = Rails.public_path.join("build/manifest.json") diff --git a/app/logical/git_helper.rb b/app/logical/git_helper.rb index 2d8de9e6..6a48690d 100644 --- a/app/logical/git_helper.rb +++ b/app/logical/git_helper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module GitHelper REPO = begin Rugged::Repository.new(Rails.root) diff --git a/app/logical/hideable_search_form_builder.rb b/app/logical/hideable_search_form_builder.rb index 329da304..823129a5 100644 --- a/app/logical/hideable_search_form_builder.rb +++ b/app/logical/hideable_search_form_builder.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class HideableSearchFormBuilder < SimpleForm::FormBuilder def input(attribute_name, options = {}, &) value = @options[:search_params][attribute_name] diff --git a/app/logical/icon_generator.rb b/app/logical/icon_generator.rb index 3f7d702b..84aca097 100644 --- a/app/logical/icon_generator.rb +++ b/app/logical/icon_generator.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module IconGenerator module_function diff --git a/app/logical/iqdb_proxy.rb b/app/logical/iqdb_proxy.rb index 889526e6..e9a320f8 100644 --- a/app/logical/iqdb_proxy.rb +++ b/app/logical/iqdb_proxy.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # Contains functions to interact with the iqdb server module IqdbProxy class Error < RuntimeError; end diff --git a/app/logical/job_stats.rb b/app/logical/job_stats.rb index e1dbe6e7..ef06412c 100644 --- a/app/logical/job_stats.rb +++ b/app/logical/job_stats.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class JobStats def active_urls (e6_iqdb_queued.keys + submission_download_queued.keys + scraping_queued.keys + scraping_now).uniq diff --git a/app/logical/pg_version_mismatch_handler.rb b/app/logical/pg_version_mismatch_handler.rb index 9275aa0e..7d0c9835 100644 --- a/app/logical/pg_version_mismatch_handler.rb +++ b/app/logical/pg_version_mismatch_handler.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class PgVersionMismatchHandler def initialize(app) @app = app diff --git a/app/logical/printable_string_validator.rb b/app/logical/printable_string_validator.rb index cfcef8ac..a0573af0 100644 --- a/app/logical/printable_string_validator.rb +++ b/app/logical/printable_string_validator.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class PrintableStringValidator < ActiveModel::EachValidator REGEX = /^[0-9a-zA-Z_.+()-]*$/ diff --git a/app/logical/scraper/artconomy.rb b/app/logical/scraper/artconomy.rb index d39f565e..f5e0e170 100644 --- a/app/logical/scraper/artconomy.rb +++ b/app/logical/scraper/artconomy.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Artconomy < Base STATE = :page diff --git a/app/logical/scraper/artfight.rb b/app/logical/scraper/artfight.rb index e47b1a94..a8574a94 100644 --- a/app/logical/scraper/artfight.rb +++ b/app/logical/scraper/artfight.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Artfight < BufferedScraper STATE = :page diff --git a/app/logical/scraper/artstation.rb b/app/logical/scraper/artstation.rb index bdbeba8a..504e5f39 100644 --- a/app/logical/scraper/artstation.rb +++ b/app/logical/scraper/artstation.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Artstation < BufferedScraper STATE = :page diff --git a/app/logical/scraper/baraag.rb b/app/logical/scraper/baraag.rb index b15d673a..b8bad7b6 100644 --- a/app/logical/scraper/baraag.rb +++ b/app/logical/scraper/baraag.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Baraag < MastodonV1 def domain diff --git a/app/logical/scraper/base.rb b/app/logical/scraper/base.rb index b2fc661d..99849d60 100644 --- a/app/logical/scraper/base.rb +++ b/app/logical/scraper/base.rb @@ -1,8 +1,6 @@ -# frozen_string_literal: true - module Scraper class Base - FRIENDLY_USER_AGENT = "FoxTrove/0.1 (by earlopain)" + FRIENDLY_USER_AGENT = "FoxTrove/0.1 (by earlopain)".freeze delegate :url_identifier, :api_identifier, to: :@artist_url attr_accessor :client diff --git a/app/logical/scraper/bluesky.rb b/app/logical/scraper/bluesky.rb index 147e4cdd..cd7c2322 100644 --- a/app/logical/scraper/bluesky.rb +++ b/app/logical/scraper/bluesky.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Bluesky < Base STATE = :cursor diff --git a/app/logical/scraper/buffered_scraper.rb b/app/logical/scraper/buffered_scraper.rb index 1b107029..2c086b5b 100644 --- a/app/logical/scraper/buffered_scraper.rb +++ b/app/logical/scraper/buffered_scraper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper # Some sites return many entries per page but fetching full data for these takes a long time. # Loading all entries just to see if something is new is bad. Buffer it instead, so that diff --git a/app/logical/scraper/cohost.rb b/app/logical/scraper/cohost.rb index 2c2d3b88..c1ce1bd6 100644 --- a/app/logical/scraper/cohost.rb +++ b/app/logical/scraper/cohost.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Cohost < Base STATE = :page diff --git a/app/logical/scraper/commishes.rb b/app/logical/scraper/commishes.rb index ff6e50a7..327ed4f1 100755 --- a/app/logical/scraper/commishes.rb +++ b/app/logical/scraper/commishes.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Commishes < BufferedScraper STATE = :until diff --git a/app/logical/scraper/deviantart.rb b/app/logical/scraper/deviantart.rb index c83898f9..e627f450 100644 --- a/app/logical/scraper/deviantart.rb +++ b/app/logical/scraper/deviantart.rb @@ -1,11 +1,9 @@ -# frozen_string_literal: true - module Scraper # https://www.deviantart.com/developers/http/v1/20210526 # https://www.deviantart.com/developers/console class Deviantart < Base STATE = :next_offset - API_PREFIX = "https://www.deviantart.com/api/v1/oauth2" + API_PREFIX = "https://www.deviantart.com/api/v1/oauth2".freeze def initialize(artist_url) super diff --git a/app/logical/scraper/furaffinity.rb b/app/logical/scraper/furaffinity.rb index 7a48b85e..16326270 100644 --- a/app/logical/scraper/furaffinity.rb +++ b/app/logical/scraper/furaffinity.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Furaffinity < BufferedScraper STATE = :page diff --git a/app/logical/scraper/furrynetwork.rb b/app/logical/scraper/furrynetwork.rb index d389abfe..f30b87f2 100644 --- a/app/logical/scraper/furrynetwork.rb +++ b/app/logical/scraper/furrynetwork.rb @@ -1,11 +1,9 @@ -# frozen_string_literal: true - module Scraper class Furrynetwork < Base STATE = :offset PER_REQUEST = 72 - API_PREFIX = "https://furrynetwork.com/api" + API_PREFIX = "https://furrynetwork.com/api".freeze def initialize(artist_url) super diff --git a/app/logical/scraper/httpx_plugin.rb b/app/logical/scraper/httpx_plugin.rb index 85c2b1f4..b0c7cf05 100644 --- a/app/logical/scraper/httpx_plugin.rb +++ b/app/logical/scraper/httpx_plugin.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper module HttpxPlugin module InstanceMethods diff --git a/app/logical/scraper/inkbunny.rb b/app/logical/scraper/inkbunny.rb index 879dd56e..57991073 100644 --- a/app/logical/scraper/inkbunny.rb +++ b/app/logical/scraper/inkbunny.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper # https://wiki.inkbunny.net/wiki/API class Inkbunny < Base diff --git a/app/logical/scraper/itaku.rb b/app/logical/scraper/itaku.rb index 1ce29a0e..899b7647 100755 --- a/app/logical/scraper/itaku.rb +++ b/app/logical/scraper/itaku.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Itaku < BufferedScraper STATE = :page diff --git a/app/logical/scraper/mastodon_v1.rb b/app/logical/scraper/mastodon_v1.rb index 13317064..45194077 100644 --- a/app/logical/scraper/mastodon_v1.rb +++ b/app/logical/scraper/mastodon_v1.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper # https://docs.joinmastodon.org/ class MastodonV1 < Base diff --git a/app/logical/scraper/newgrounds.rb b/app/logical/scraper/newgrounds.rb index cf46dbc9..78e6f909 100644 --- a/app/logical/scraper/newgrounds.rb +++ b/app/logical/scraper/newgrounds.rb @@ -1,9 +1,7 @@ -# frozen_string_literal: true - module Scraper class Newgrounds < BufferedScraper STATE = :page - COOKIE_NAME = "vmkIdu5l8m" + COOKIE_NAME = "vmkIdu5l8m".freeze def initialize(artist_url) super diff --git a/app/logical/scraper/omorashi.rb b/app/logical/scraper/omorashi.rb index 83d30ce9..cf39fa5e 100644 --- a/app/logical/scraper/omorashi.rb +++ b/app/logical/scraper/omorashi.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Omorashi < BufferedScraper STATE = :page diff --git a/app/logical/scraper/pawoo.rb b/app/logical/scraper/pawoo.rb index 9bc4ee0e..ac691b59 100644 --- a/app/logical/scraper/pawoo.rb +++ b/app/logical/scraper/pawoo.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Pawoo < MastodonV1 def domain diff --git a/app/logical/scraper/piczel.rb b/app/logical/scraper/piczel.rb index e2563a64..9cebb280 100644 --- a/app/logical/scraper/piczel.rb +++ b/app/logical/scraper/piczel.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Piczel < Base STATE = :from_id diff --git a/app/logical/scraper/pixiv.rb b/app/logical/scraper/pixiv.rb index edbf0912..f179a3ba 100644 --- a/app/logical/scraper/pixiv.rb +++ b/app/logical/scraper/pixiv.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper # https://gist.github.com/upbit/6edda27cb1644e94183291109b8a5fde # https://github.com/upbit/pixivpy/wiki/Sniffer-for-iOS-6.x---Common-API @@ -8,15 +6,15 @@ module Scraper class Pixiv < Base STATE = :offset - API_BASE_URL = "https://app-api.pixiv.net/v1" - LOGIN_URL = "https://app-api.pixiv.net/web/v1/login" - REDIRECT_URI = "https://app-api.pixiv.net/web/v1/users/auth/pixiv/callback" - AUTH_TOKEN_URL = "https://oauth.secure.pixiv.net/auth/token" - OS_VERSION = "14.6" - APP_VERSION = "7.13.3" + API_BASE_URL = "https://app-api.pixiv.net/v1".freeze + LOGIN_URL = "https://app-api.pixiv.net/web/v1/login".freeze + REDIRECT_URI = "https://app-api.pixiv.net/web/v1/users/auth/pixiv/callback".freeze + AUTH_TOKEN_URL = "https://oauth.secure.pixiv.net/auth/token".freeze + OS_VERSION = "14.6".freeze + APP_VERSION = "7.13.3".freeze USER_AGENT = "PixivIOSApp/#{APP_VERSION} (iOS #{OS_VERSION}; iPhone13,2)".freeze - CLIENT_ID = "MOBrBDS8blbauoSck0ZfDbtuzpyT" - CLIENT_SECRET = "lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj" + CLIENT_ID = "MOBrBDS8blbauoSck0ZfDbtuzpyT".freeze + CLIENT_SECRET = "lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj".freeze PER_PAGE = 30 def initialize(artist_url) diff --git a/app/logical/scraper/reddit.rb b/app/logical/scraper/reddit.rb index 69f21ee8..f0e6921a 100644 --- a/app/logical/scraper/reddit.rb +++ b/app/logical/scraper/reddit.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper # https://www.reddit.com/dev/api/ class Reddit < Base diff --git a/app/logical/scraper/sofurry.rb b/app/logical/scraper/sofurry.rb index 4e20e12c..6a31ed94 100644 --- a/app/logical/scraper/sofurry.rb +++ b/app/logical/scraper/sofurry.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper # This is unnecessarily convoluted. Let's hope Sofurry Next will actually happen sometime # https://wiki.sofurry.com/wiki/SoFurry_2.0_API diff --git a/app/logical/scraper/submission.rb b/app/logical/scraper/submission.rb index 9a925098..2c53e548 100644 --- a/app/logical/scraper/submission.rb +++ b/app/logical/scraper/submission.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Submission attr_accessor :identifier, :created_at, :updated_at, :title, :description, :files diff --git a/app/logical/scraper/tumblr.rb b/app/logical/scraper/tumblr.rb index fda26153..6d5b911b 100644 --- a/app/logical/scraper/tumblr.rb +++ b/app/logical/scraper/tumblr.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper # https://www.tumblr.com/docs/en/api/v2 # This doesn't download the images, they just get reblogged diff --git a/app/logical/scraper/twitter.rb b/app/logical/scraper/twitter.rb index 0f2008d6..1916c235 100644 --- a/app/logical/scraper/twitter.rb +++ b/app/logical/scraper/twitter.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper class Twitter < Base # Inspired by https://github.com/JustAnotherArchivist/snscrape/blob/e7d35ec1ebb008108082fc79161f351bc8a707e4/snscrape/modules/twitter.py @@ -8,9 +6,9 @@ class ApiError < RuntimeError; end OPTIONAL_CONFIG_KEYS = %i[twitter_otp_secret].freeze STATE = :cursor - BEARER_TOKEN = "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs=1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA" - DATETIME_FORMAT = "%a %b %d %H:%M:%S %z %Y" - API_BASE_URL = "https://twitter.com/i/api/graphql" + BEARER_TOKEN = "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs=1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA".freeze + DATETIME_FORMAT = "%a %b %d %H:%M:%S %z %Y".freeze + API_BASE_URL = "https://twitter.com/i/api/graphql".freeze def initialize(artist_url) super diff --git a/app/logical/scraper/weasyl.rb b/app/logical/scraper/weasyl.rb index bdca70ef..e0500845 100644 --- a/app/logical/scraper/weasyl.rb +++ b/app/logical/scraper/weasyl.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Scraper # https://projects.weasyl.com/weasylapi/ class Weasyl < Base diff --git a/app/logical/selenium_wrapper.rb b/app/logical/selenium_wrapper.rb index 275858d1..87fb5fed 100644 --- a/app/logical/selenium_wrapper.rb +++ b/app/logical/selenium_wrapper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class SeleniumWrapper DEFAULT_TIMEOUT = 60 diff --git a/app/logical/sites.rb b/app/logical/sites.rb index f4c3911b..73da288b 100644 --- a/app/logical/sites.rb +++ b/app/logical/sites.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Sites module_function diff --git a/app/logical/sites/identifier_processor.rb b/app/logical/sites/identifier_processor.rb index 568b682d..9a73bc07 100644 --- a/app/logical/sites/identifier_processor.rb +++ b/app/logical/sites/identifier_processor.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Sites class IdentifierProcessor def self.match(name) diff --git a/app/logical/sites/manual_definition.rb b/app/logical/sites/manual_definition.rb index e95fbeed..612d1f91 100644 --- a/app/logical/sites/manual_definition.rb +++ b/app/logical/sites/manual_definition.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Sites class ManualDefinition < SimpleDefinition def gallery_url(identifier) diff --git a/app/logical/sites/scraper_definition.rb b/app/logical/sites/scraper_definition.rb index 1d532687..98fbdf9a 100644 --- a/app/logical/sites/scraper_definition.rb +++ b/app/logical/sites/scraper_definition.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Sites class ScraperDefinition < SimpleDefinition def initialize(definition_data) diff --git a/app/logical/sites/simple_definition.rb b/app/logical/sites/simple_definition.rb index 9fd4e01e..c80d909d 100644 --- a/app/logical/sites/simple_definition.rb +++ b/app/logical/sites/simple_definition.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module Sites class SimpleDefinition attr_reader :site_type, :display_name, :homepage, :gallery_templates, :username_identifier_regex, :image_domains, :download_headers diff --git a/app/logical/variant_generator.rb b/app/logical/variant_generator.rb index e07b0bd4..ebf0b0a7 100644 --- a/app/logical/variant_generator.rb +++ b/app/logical/variant_generator.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - module VariantGenerator THUMBNAIL_SIZE = 300 diff --git a/app/models/application_record.rb b/app/models/application_record.rb index b25f4f29..f7b46e75 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ApplicationRecord < ActiveRecord::Base self.abstract_class = true diff --git a/app/models/artist.rb b/app/models/artist.rb index c118d7a0..c6c98519 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class Artist < ApplicationRecord has_many :artist_urls, dependent: :destroy has_many :submissions, through: :artist_urls diff --git a/app/models/artist_submission.rb b/app/models/artist_submission.rb index f6a3e201..5c1778d1 100644 --- a/app/models/artist_submission.rb +++ b/app/models/artist_submission.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ArtistSubmission < ApplicationRecord belongs_to :artist_url has_one :artist, through: :artist_url diff --git a/app/models/artist_url.rb b/app/models/artist_url.rb index d201be67..f91f1b99 100644 --- a/app/models/artist_url.rb +++ b/app/models/artist_url.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class ArtistUrl < ApplicationRecord class MissingApiIdentifier < StandardError def initialize(url_identifier, site_type) diff --git a/app/models/e6_post.rb b/app/models/e6_post.rb index 81b4a6a9..1e9b16ff 100644 --- a/app/models/e6_post.rb +++ b/app/models/e6_post.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class E6Post < ApplicationRecord belongs_to :submission_file diff --git a/app/models/log_event.rb b/app/models/log_event.rb index 201443af..31227beb 100644 --- a/app/models/log_event.rb +++ b/app/models/log_event.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class LogEvent < ApplicationRecord belongs_to :loggable, polymorphic: true diff --git a/app/models/submission_file.rb b/app/models/submission_file.rb index b26b251b..ce8fb52d 100644 --- a/app/models/submission_file.rb +++ b/app/models/submission_file.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class SubmissionFile < ApplicationRecord belongs_to :artist_submission has_many :e6_posts, dependent: :destroy diff --git a/config.ru b/config.ru index 2e030846..4a3c09a6 100644 --- a/config.ru +++ b/config.ru @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # This file is used by Rack-based servers to start the application. require_relative "config/environment" diff --git a/config/application.rb b/config/application.rb index 31118f9f..6968a951 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require_relative "boot" require "rails" diff --git a/config/boot.rb b/config/boot.rb index c2241d70..28201161 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile. diff --git a/config/environment.rb b/config/environment.rb index 7df99e89..cac53157 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # Load the Rails application. require_relative "application" diff --git a/config/environments/development.rb b/config/environments/development.rb index 74a53564..6cbb3fe9 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "active_support/core_ext/integer/time" Rails.application.configure do diff --git a/config/environments/test.rb b/config/environments/test.rb index fd9731df..7ab23892 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "active_support/core_ext/integer/time" # The test environment is used exclusively to run your application's diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 1cb3a609..b889833c 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # Be sure to restart your server when you modify this file. # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. diff --git a/config/initializers/listen.rb b/config/initializers/listen.rb index 79807c73..df8487c9 100644 --- a/config/initializers/listen.rb +++ b/config/initializers/listen.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - Rails.application.config.after_initialize do Listen.to(Rails.root.join("config"), only: /foxtrove.*\.yml/) do Config.reset_cache diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index 3c0db7b7..cc295292 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "pagy/extras/i18n" require "pagy/extras/overflow" require "pagy/extras/size" diff --git a/config/initializers/postgres.rb b/config/initializers/postgres.rb index dac7835a..db1fb838 100644 --- a/config/initializers/postgres.rb +++ b/config/initializers/postgres.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - ActiveSupport.on_load(:active_record_postgresqladapter) do self.datetime_type = :timestamptz end diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index db266ee6..8e9c57c0 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # Uncomment this and change the path if necessary to include your own # components. # See https://github.com/heartcombo/simple_form#custom-components to know diff --git a/config/initializers/zip.rb b/config/initializers/zip.rb index 37485bf9..878ae6d7 100644 --- a/config/initializers/zip.rb +++ b/config/initializers/zip.rb @@ -1,3 +1 @@ -# frozen_string_literal: true - Zip.warn_invalid_date = false diff --git a/config/routes.rb b/config/routes.rb index 29f8a45f..b64bf084 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - Rails.application.routes.draw do mount GoodJob::Engine, at: "/good_job" diff --git a/db/migrate/20211216211836_create_active_storage_tables.active_storage.rb b/db/migrate/20211216211836_create_active_storage_tables.active_storage.rb index 414a2288..07658f3e 100644 --- a/db/migrate/20211216211836_create_active_storage_tables.active_storage.rb +++ b/db/migrate/20211216211836_create_active_storage_tables.active_storage.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # This migration comes from active_storage (originally 20170806125915) class CreateActiveStorageTables < ActiveRecord::Migration[5.2] def change diff --git a/db/migrate/20221024193224_create_good_jobs.rb b/db/migrate/20221024193224_create_good_jobs.rb index fada54c2..abc4e0a5 100644 --- a/db/migrate/20221024193224_create_good_jobs.rb +++ b/db/migrate/20221024193224_create_good_jobs.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobs < ActiveRecord::Migration[7.0] def change enable_extension "pgcrypto" diff --git a/db/migrate/20230108111013_rename_e6_posts_table.rb b/db/migrate/20230108111013_rename_e6_posts_table.rb index db2fcee1..6f9bad4f 100644 --- a/db/migrate/20230108111013_rename_e6_posts_table.rb +++ b/db/migrate/20230108111013_rename_e6_posts_table.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class RenameE6PostsTable < ActiveRecord::Migration[7.0] def change rename_table :e6_iqdb_data, :e6_posts diff --git a/db/migrate/20230210082852_create_good_job_batches.rb b/db/migrate/20230210082852_create_good_job_batches.rb index ac6c5b37..84bb6efd 100644 --- a/db/migrate/20230210082852_create_good_job_batches.rb +++ b/db/migrate/20230210082852_create_good_job_batches.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobBatches < ActiveRecord::Migration[7.0] def change reversible do |dir| diff --git a/db/migrate/20230918172046_create_good_job_executions.rb b/db/migrate/20230918172046_create_good_job_executions.rb index 523c5689..e5af6296 100644 --- a/db/migrate/20230918172046_create_good_job_executions.rb +++ b/db/migrate/20230918172046_create_good_job_executions.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobExecutions < ActiveRecord::Migration[7.0] def change reversible do |dir| diff --git a/db/migrate/20230918172047_create_good_jobs_error_event.rb b/db/migrate/20230918172047_create_good_jobs_error_event.rb index b07e0f14..07572ec0 100644 --- a/db/migrate/20230918172047_create_good_jobs_error_event.rb +++ b/db/migrate/20230918172047_create_good_jobs_error_event.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobsErrorEvent < ActiveRecord::Migration[7.0] def change reversible do |dir| diff --git a/db/migrate/20230922142507_add_scraper_status.rb b/db/migrate/20230922142507_add_scraper_status.rb index 2c34776d..f933d756 100644 --- a/db/migrate/20230922142507_add_scraper_status.rb +++ b/db/migrate/20230922142507_add_scraper_status.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class AddScraperStatus < ActiveRecord::Migration[7.0] def change add_column :artist_urls, :scraper_status, :jsonb, null: false, default: {} diff --git a/db/migrate/20231111120419_add_corrupt_column.rb b/db/migrate/20231111120419_add_corrupt_column.rb index 0b9ca8d5..33c356e2 100644 --- a/db/migrate/20231111120419_add_corrupt_column.rb +++ b/db/migrate/20231111120419_add_corrupt_column.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class AddCorruptColumn < ActiveRecord::Migration[7.1] def change add_column :submission_files, :file_error, :string diff --git a/db/migrate/20240112091109_recreate_good_job_cron_indexes_with_conditional.rb b/db/migrate/20240112091109_recreate_good_job_cron_indexes_with_conditional.rb index 2fef2d4e..f30f9c75 100644 --- a/db/migrate/20240112091109_recreate_good_job_cron_indexes_with_conditional.rb +++ b/db/migrate/20240112091109_recreate_good_job_cron_indexes_with_conditional.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class RecreateGoodJobCronIndexesWithConditional < ActiveRecord::Migration[7.1] disable_ddl_transaction! diff --git a/db/migrate/20240112091110_create_good_job_labels.rb b/db/migrate/20240112091110_create_good_job_labels.rb index 1ba514e8..5fb5b612 100644 --- a/db/migrate/20240112091110_create_good_job_labels.rb +++ b/db/migrate/20240112091110_create_good_job_labels.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobLabels < ActiveRecord::Migration[7.1] def change reversible do |dir| diff --git a/db/migrate/20240112091111_create_good_job_labels_index.rb b/db/migrate/20240112091111_create_good_job_labels_index.rb index 65dedd47..5af66b42 100644 --- a/db/migrate/20240112091111_create_good_job_labels_index.rb +++ b/db/migrate/20240112091111_create_good_job_labels_index.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobLabelsIndex < ActiveRecord::Migration[7.1] disable_ddl_transaction! diff --git a/db/migrate/20240112091112_remove_good_job_active_id_index.rb b/db/migrate/20240112091112_remove_good_job_active_id_index.rb index 8601f071..4a37913f 100644 --- a/db/migrate/20240112091112_remove_good_job_active_id_index.rb +++ b/db/migrate/20240112091112_remove_good_job_active_id_index.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class RemoveGoodJobActiveIdIndex < ActiveRecord::Migration[7.1] disable_ddl_transaction! diff --git a/db/migrate/20240128115103_add_artist_url_scraper_stop_marker.rb b/db/migrate/20240128115103_add_artist_url_scraper_stop_marker.rb index 3544ffd0..8d5ad053 100644 --- a/db/migrate/20240128115103_add_artist_url_scraper_stop_marker.rb +++ b/db/migrate/20240128115103_add_artist_url_scraper_stop_marker.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class AddArtistUrlScraperStopMarker < ActiveRecord::Migration[7.1] def change add_column :artist_urls, :scraper_stop_marker, :datetime diff --git a/db/migrate/20240202181641_create_index_good_job_jobs_for_candidate_lookup.rb b/db/migrate/20240202181641_create_index_good_job_jobs_for_candidate_lookup.rb index 082a8407..2fc35b0f 100644 --- a/db/migrate/20240202181641_create_index_good_job_jobs_for_candidate_lookup.rb +++ b/db/migrate/20240202181641_create_index_good_job_jobs_for_candidate_lookup.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateIndexGoodJobJobsForCandidateLookup < ActiveRecord::Migration[7.1] disable_ddl_transaction! diff --git a/db/migrate/20240512203757_create_good_job_execution_error_backtrace.rb b/db/migrate/20240512203757_create_good_job_execution_error_backtrace.rb index 6b054b64..1eee3f24 100644 --- a/db/migrate/20240512203757_create_good_job_execution_error_backtrace.rb +++ b/db/migrate/20240512203757_create_good_job_execution_error_backtrace.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobExecutionErrorBacktrace < ActiveRecord::Migration[7.1] def change reversible do |dir| diff --git a/db/migrate/20240621201111_create_good_job_process_lock_ids.rb b/db/migrate/20240621201111_create_good_job_process_lock_ids.rb index 72f86525..157b3606 100644 --- a/db/migrate/20240621201111_create_good_job_process_lock_ids.rb +++ b/db/migrate/20240621201111_create_good_job_process_lock_ids.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobProcessLockIds < ActiveRecord::Migration[7.1] def change reversible do |dir| diff --git a/db/migrate/20240621201112_create_good_job_process_lock_indexes.rb b/db/migrate/20240621201112_create_good_job_process_lock_indexes.rb index 2b548ed4..4cad5660 100644 --- a/db/migrate/20240621201112_create_good_job_process_lock_indexes.rb +++ b/db/migrate/20240621201112_create_good_job_process_lock_indexes.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobProcessLockIndexes < ActiveRecord::Migration[7.1] disable_ddl_transaction! diff --git a/db/migrate/20240706103931_create_good_job_execution_duration.rb b/db/migrate/20240706103931_create_good_job_execution_duration.rb index fef37f07..637fc38f 100644 --- a/db/migrate/20240706103931_create_good_job_execution_duration.rb +++ b/db/migrate/20240706103931_create_good_job_execution_duration.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class CreateGoodJobExecutionDuration < ActiveRecord::Migration[7.1] def change reversible do |dir| diff --git a/lib/tasks/foxtrove.rake b/lib/tasks/foxtrove.rake index 920a3394..80a1a940 100644 --- a/lib/tasks/foxtrove.rake +++ b/lib/tasks/foxtrove.rake @@ -1,5 +1,3 @@ -# frozen_string_literal: true - namespace :foxtrove do desc "Generate the icon spritemap" task generate_spritemap: :environment do diff --git a/test/controllers/application_controller_test.rb b/test/controllers/application_controller_test.rb index 14a3f18e..28a40ecb 100644 --- a/test/controllers/application_controller_test.rb +++ b/test/controllers/application_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ApplicationControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/archive_imports_controller_test.rb b/test/controllers/archive_imports_controller_test.rb index 2632058c..1bffb105 100644 --- a/test/controllers/archive_imports_controller_test.rb +++ b/test/controllers/archive_imports_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class IqdbControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/artist_urls_controller_test.rb b/test/controllers/artist_urls_controller_test.rb index 11620538..c98928f6 100644 --- a/test/controllers/artist_urls_controller_test.rb +++ b/test/controllers/artist_urls_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ArtistUrlsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/artists_controller_test.rb b/test/controllers/artists_controller_test.rb index 47a661ea..3beb341d 100644 --- a/test/controllers/artists_controller_test.rb +++ b/test/controllers/artists_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ArtistsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/config_controller_test.rb b/test/controllers/config_controller_test.rb index 4100c1f1..504a6a63 100644 --- a/test/controllers/config_controller_test.rb +++ b/test/controllers/config_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ConfigControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/iqdb_controller_test.rb b/test/controllers/iqdb_controller_test.rb index 24336a5e..b5af4d12 100644 --- a/test/controllers/iqdb_controller_test.rb +++ b/test/controllers/iqdb_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class IqdbControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/log_events_controller_test.rb b/test/controllers/log_events_controller_test.rb index ded81e59..2a9b1c05 100644 --- a/test/controllers/log_events_controller_test.rb +++ b/test/controllers/log_events_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class IqdbControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/stats_controller_test.rb b/test/controllers/stats_controller_test.rb index 1e0cba67..75effa02 100644 --- a/test/controllers/stats_controller_test.rb +++ b/test/controllers/stats_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class StatsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/submission_files_controller_test.rb b/test/controllers/submission_files_controller_test.rb index 740bda98..8efa07a5 100644 --- a/test/controllers/submission_files_controller_test.rb +++ b/test/controllers/submission_files_controller_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class SubmissionFilesControllerTest < ActionDispatch::IntegrationTest diff --git a/test/factories/artist_factory.rb b/test/factories/artist_factory.rb index 0323ced9..1e1f87ad 100644 --- a/test/factories/artist_factory.rb +++ b/test/factories/artist_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :artist do sequence(:name) { |n| "artist#{n}" } diff --git a/test/factories/artist_submission_factory.rb b/test/factories/artist_submission_factory.rb index 16635337..8fa9ef50 100644 --- a/test/factories/artist_submission_factory.rb +++ b/test/factories/artist_submission_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :artist_submission do association :artist_url diff --git a/test/factories/artist_url_factory.rb b/test/factories/artist_url_factory.rb index 8a1efa01..e6e8122c 100644 --- a/test/factories/artist_url_factory.rb +++ b/test/factories/artist_url_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :artist_url do association :artist diff --git a/test/factories/e6_post_factory.rb b/test/factories/e6_post_factory.rb index b65da728..889ffcbe 100644 --- a/test/factories/e6_post_factory.rb +++ b/test/factories/e6_post_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :e6_post do association :submission_file diff --git a/test/factories/log_event_factory.rb b/test/factories/log_event_factory.rb index a3cda472..94120ad2 100644 --- a/test/factories/log_event_factory.rb +++ b/test/factories/log_event_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :log_event do action { :scraper_request } diff --git a/test/factories/submission_file_factory.rb b/test/factories/submission_file_factory.rb index 3f10a027..902574c7 100644 --- a/test/factories/submission_file_factory.rb +++ b/test/factories/submission_file_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :submission_file do association :artist_submission diff --git a/test/factories/web/e6_iqdb_response_factory.rb b/test/factories/web/e6_iqdb_response_factory.rb index f676a775..4f58a29d 100644 --- a/test/factories/web/e6_iqdb_response_factory.rb +++ b/test/factories/web/e6_iqdb_response_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :e6_iqdb_response, parent: :json do post_ids { [] } diff --git a/test/factories/web/e6_post_response_factory.rb b/test/factories/web/e6_post_response_factory.rb index f3b0751e..b46b2c44 100644 --- a/test/factories/web/e6_post_response_factory.rb +++ b/test/factories/web/e6_post_response_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :e6_post_response, parent: :json do post_id { nil } diff --git a/test/factories/web/json_factory.rb b/test/factories/web/json_factory.rb index 101be044..1480a7b2 100644 --- a/test/factories/web/json_factory.rb +++ b/test/factories/web/json_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :json, class: Hash do skip_create diff --git a/test/factories/web/twitter_extended_media_factory.rb b/test/factories/web/twitter_extended_media_factory.rb index 0337811e..58dbe236 100644 --- a/test/factories/web/twitter_extended_media_factory.rb +++ b/test/factories/web/twitter_extended_media_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :twitter_extended_media, parent: :json do type { nil } diff --git a/test/factories/web/twitter_timeline_factory.rb b/test/factories/web/twitter_timeline_factory.rb index df2fbd73..ea4efab3 100644 --- a/test/factories/web/twitter_timeline_factory.rb +++ b/test/factories/web/twitter_timeline_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :twitter_timeline, parent: :json do instructions { [] } diff --git a/test/factories/web/twitter_tweet_factory.rb b/test/factories/web/twitter_tweet_factory.rb index f7b9505f..81817e79 100644 --- a/test/factories/web/twitter_tweet_factory.rb +++ b/test/factories/web/twitter_tweet_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :twitter_tweet, parent: :json do rest_id { "123" } diff --git a/test/factories/web/twitter_url_factory_factory.rb b/test/factories/web/twitter_url_factory_factory.rb index bd2c2614..75c68cec 100644 --- a/test/factories/web/twitter_url_factory_factory.rb +++ b/test/factories/web/twitter_url_factory_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :twitter_url_entity, parent: :json do short_url { nil } diff --git a/test/factories/web/twitter_user_media_last_page_factory.rb b/test/factories/web/twitter_user_media_last_page_factory.rb index 62e811dd..43dce9d0 100644 --- a/test/factories/web/twitter_user_media_last_page_factory.rb +++ b/test/factories/web/twitter_user_media_last_page_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :twitter_user_media_last_page, parent: :twitter_timeline do instructions do diff --git a/test/factories/web/twitter_user_media_page1_factory.rb b/test/factories/web/twitter_user_media_page1_factory.rb index d8e679a9..112b5cd2 100644 --- a/test/factories/web/twitter_user_media_page1_factory.rb +++ b/test/factories/web/twitter_user_media_page1_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :twitter_user_media_page1, parent: :twitter_timeline do instructions do diff --git a/test/factories/web/twitter_user_media_page2_factory.rb b/test/factories/web/twitter_user_media_page2_factory.rb index cb0484fe..98f86ae8 100644 --- a/test/factories/web/twitter_user_media_page2_factory.rb +++ b/test/factories/web/twitter_user_media_page2_factory.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - FactoryBot.define do factory :twitter_user_media_page2, parent: :twitter_timeline do instructions do diff --git a/test/jobs/e6_iqdb_query_job_test.rb b/test/jobs/e6_iqdb_query_job_test.rb index 5987d3ec..d0c985fa 100644 --- a/test/jobs/e6_iqdb_query_job_test.rb +++ b/test/jobs/e6_iqdb_query_job_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class E6IqdbQueryJobTest < ActiveJob::TestCase diff --git a/test/jobs/purge_log_events_job_test.rb b/test/jobs/purge_log_events_job_test.rb index 49b09a28..311e0a8a 100644 --- a/test/jobs/purge_log_events_job_test.rb +++ b/test/jobs/purge_log_events_job_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class PurgeLogEventsJobTest < ActiveJob::TestCase diff --git a/test/jobs/purge_unattached_blobs_job_test.rb b/test/jobs/purge_unattached_blobs_job_test.rb index 832b84cc..fa9aebc7 100644 --- a/test/jobs/purge_unattached_blobs_job_test.rb +++ b/test/jobs/purge_unattached_blobs_job_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class PurgeUnattachedBlobsJobTest < ActiveJob::TestCase diff --git a/test/logical/archives/manual_test.rb b/test/logical/archives/manual_test.rb index 1e2989aa..8eb50370 100644 --- a/test/logical/archives/manual_test.rb +++ b/test/logical/archives/manual_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" module Archives diff --git a/test/logical/config_test.rb b/test/logical/config_test.rb index 41b0db88..3c528928 100644 --- a/test/logical/config_test.rb +++ b/test/logical/config_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ConfigTest < ActiveSupport::TestCase diff --git a/test/logical/docker_env_test.rb b/test/logical/docker_env_test.rb index 50987f59..00b6f6b7 100644 --- a/test/logical/docker_env_test.rb +++ b/test/logical/docker_env_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class DockerEnvTest < ActiveSupport::TestCase diff --git a/test/logical/e6_api_client_test.rb b/test/logical/e6_api_client_test.rb index 9f715512..87537978 100644 --- a/test/logical/e6_api_client_test.rb +++ b/test/logical/e6_api_client_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class E6ApiClientTest < ActiveSupport::TestCase diff --git a/test/logical/esbuild_manifest_test.rb b/test/logical/esbuild_manifest_test.rb index 2075b4e2..a58520d8 100644 --- a/test/logical/esbuild_manifest_test.rb +++ b/test/logical/esbuild_manifest_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class EsbuildManifestTest < ActiveSupport::TestCase diff --git a/test/logical/good_job_test.rb b/test/logical/good_job_test.rb index c68d7d60..4175c006 100644 --- a/test/logical/good_job_test.rb +++ b/test/logical/good_job_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class GoodJobTest < ActiveSupport::TestCase diff --git a/test/logical/icon_generator_test.rb b/test/logical/icon_generator_test.rb index 5457dd4a..77c5e505 100644 --- a/test/logical/icon_generator_test.rb +++ b/test/logical/icon_generator_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class IconGeneratorTest < ActiveSupport::TestCase diff --git a/test/logical/iqdb_proxy_test.rb b/test/logical/iqdb_proxy_test.rb index 294fc3df..8bb32ef5 100644 --- a/test/logical/iqdb_proxy_test.rb +++ b/test/logical/iqdb_proxy_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class IqdbProxyTest < ActiveSupport::TestCase diff --git a/test/logical/job_stats_test.rb b/test/logical/job_stats_test.rb index 166219f7..77455198 100644 --- a/test/logical/job_stats_test.rb +++ b/test/logical/job_stats_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class JobStatsTest < ActiveJob::TestCase diff --git a/test/logical/pg_version_mismatch_handler_test.rb b/test/logical/pg_version_mismatch_handler_test.rb index 3efc119d..8d5a5a8b 100644 --- a/test/logical/pg_version_mismatch_handler_test.rb +++ b/test/logical/pg_version_mismatch_handler_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class PgVersionMismatchHandlerTest < ActionDispatch::IntegrationTest diff --git a/test/logical/scraper/base_test.rb b/test/logical/scraper/base_test.rb index 6a5d38f2..3143882e 100644 --- a/test/logical/scraper/base_test.rb +++ b/test/logical/scraper/base_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" module Scraper diff --git a/test/logical/scraper/httpx_plugin_test.rb b/test/logical/scraper/httpx_plugin_test.rb index b64c8016..896136ab 100644 --- a/test/logical/scraper/httpx_plugin_test.rb +++ b/test/logical/scraper/httpx_plugin_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" module Scraper diff --git a/test/logical/scraper/live_test.rb b/test/logical/scraper/live_test.rb index 42e6e569..d2f7fc3d 100644 --- a/test/logical/scraper/live_test.rb +++ b/test/logical/scraper/live_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" module Scraper diff --git a/test/logical/scraper/reddit_test.rb b/test/logical/scraper/reddit_test.rb index 181e4a10..b04684b8 100644 --- a/test/logical/scraper/reddit_test.rb +++ b/test/logical/scraper/reddit_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" module Scraper diff --git a/test/logical/scraper/twitter_test.rb b/test/logical/scraper/twitter_test.rb index d6d23d11..8c136e47 100644 --- a/test/logical/scraper/twitter_test.rb +++ b/test/logical/scraper/twitter_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" module Scraper diff --git a/test/logical/selenium_wrapper_test.rb b/test/logical/selenium_wrapper_test.rb index fa195fab..a3c16eab 100644 --- a/test/logical/selenium_wrapper_test.rb +++ b/test/logical/selenium_wrapper_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class SeleniumWrapperTest < ActiveSupport::TestCase diff --git a/test/logical/sites/scraper_definition_test.rb b/test/logical/sites/scraper_definition_test.rb index ac63ae17..cf57e983 100644 --- a/test/logical/sites/scraper_definition_test.rb +++ b/test/logical/sites/scraper_definition_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ScraperDefinitionTest < ActiveSupport::TestCase diff --git a/test/logical/sites_test.rb b/test/logical/sites_test.rb index 1e7313e9..5c6e1c1f 100644 --- a/test/logical/sites_test.rb +++ b/test/logical/sites_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class SitesTest < ActiveSupport::TestCase diff --git a/test/logical/templates_test.rb b/test/logical/templates_test.rb index 0bc9815f..b19b38ec 100644 --- a/test/logical/templates_test.rb +++ b/test/logical/templates_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class TemplatesTest < ActiveSupport::TestCase diff --git a/test/logical/zeitwerk_test.rb b/test/logical/zeitwerk_test.rb index 6b280237..4d3b2151 100644 --- a/test/logical/zeitwerk_test.rb +++ b/test/logical/zeitwerk_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ZeitwerkTest < ActiveSupport::TestCase diff --git a/test/model/application_record_test.rb b/test/model/application_record_test.rb index 3d5307f8..170ba5c3 100644 --- a/test/model/application_record_test.rb +++ b/test/model/application_record_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ApplicationRecordTest < ActiveSupport::TestCase diff --git a/test/model/artist_test.rb b/test/model/artist_test.rb index 06aee3d8..49e0934c 100644 --- a/test/model/artist_test.rb +++ b/test/model/artist_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ArtistTest < ActiveSupport::TestCase diff --git a/test/model/artist_url_test.rb b/test/model/artist_url_test.rb index 67ca2a4b..8a43be13 100644 --- a/test/model/artist_url_test.rb +++ b/test/model/artist_url_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class ArtistUrlTest < ActiveSupport::TestCase diff --git a/test/model/submission_file_test.rb b/test/model/submission_file_test.rb index 2d6e087b..70d36eb2 100644 --- a/test/model/submission_file_test.rb +++ b/test/model/submission_file_test.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require "test_helper" class SubmissionFileTest < ActiveSupport::TestCase diff --git a/test/test_helper.rb b/test/test_helper.rb index 4518de97..a5e03c8e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - ENV["RAILS_ENV"] ||= "test" ENV["MT_NO_EXPECTATIONS"] ||= "1"