default freeze string literals where present

This commit is contained in:
Kyle Drake 2024-01-09 12:49:17 -06:00
parent 19dadfd6d2
commit 0888c9e2df
10 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
RubyVM::YJIT.enable RubyVM::YJIT.enable
ENV['RACK_ENV'] ||= 'development' ENV['RACK_ENV'] ||= 'development'
ENV['TZ'] = 'UTC' ENV['TZ'] = 'UTC'

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Event < Sequel::Model class Event < Sequel::Model
include Sequel::ParanoidDelete include Sequel::ParanoidDelete

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'tilt' require 'tilt'
require 'rss' require 'rss'
require 'nokogiri' require 'nokogiri'
@ -144,7 +145,7 @@ class Site < Sequel::Model
BLOCK_JERK_PERCENTAGE = 30 BLOCK_JERK_PERCENTAGE = 30
BLOCK_JERK_THRESHOLD = 25 BLOCK_JERK_THRESHOLD = 25
MAXIMUM_TAGS = 5 MAXIMUM_TAGS = 5
MAX_USERNAME_LENGTH = 32.freeze MAX_USERNAME_LENGTH = 32
LEGACY_SUPPORTER_PRICES = { LEGACY_SUPPORTER_PRICES = {
plan_one: 1, plan_one: 1,

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class SiteChange < Sequel::Model class SiteChange < Sequel::Model
NEW_CHANGE_TIMEOUT = 3600 * 24 # 24 hours NEW_CHANGE_TIMEOUT = 3600 * 24 # 24 hours
many_to_one :site many_to_one :site

View file

@ -1,8 +1,10 @@
# frozen_string_literal: true
require 'sanitize' require 'sanitize'
class SiteFile < Sequel::Model class SiteFile < Sequel::Model
CLASSIFIER_LIMIT = 1_000_000.freeze CLASSIFIER_LIMIT = 1_000_000
CLASSIFIER_WORD_LIMIT = 25.freeze CLASSIFIER_WORD_LIMIT = 25
unrestrict_primary_key unrestrict_primary_key
plugin :update_primary_key plugin :update_primary_key
many_to_one :site many_to_one :site

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'resolv' require 'resolv'
require 'zlib' require 'zlib'

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'geoip' require 'geoip'
class StatLocation < Sequel::Model class StatLocation < Sequel::Model

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class StatPath < Sequel::Model class StatPath < Sequel::Model
RETAINMENT_DAYS = 7 RETAINMENT_DAYS = 7

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class StatReferrer < Sequel::Model class StatReferrer < Sequel::Model
many_to_one :site many_to_one :site
RETAINMENT_DAYS = 7 RETAINMENT_DAYS = 7

View file

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Tag < Sequel::Model class Tag < Sequel::Model
NAME_LENGTH_MAX = 25 NAME_LENGTH_MAX = 25
NAME_WORDS_MAX = 1 NAME_WORDS_MAX = 1