Skip to content

Commit

Permalink
🧹 Autocorrect frozen string literals
Browse files Browse the repository at this point in the history
```sh
rubocop --only Style/FrozenStringLiteralComment -A
```
  • Loading branch information
kirkkwang committed Dec 13, 2023
1 parent fecb4e9 commit 6859d73
Show file tree
Hide file tree
Showing 56 changed files with 65 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 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.

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/hyrax/dashboard/collections_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# OVERRIDE Hyrax v3.4.2
# - Fix file upload in logo and banner
# - Use work titles for collection thumbnail select & to add an option to reset to the default thumbnail
Expand Down
2 changes: 2 additions & 0 deletions bin/bundle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
2 changes: 2 additions & 0 deletions bin/extract_mods_to_spreadsheet
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#!/usr/bin/env ruby

# this script is intented to produce a sample spreadsheet from
Expand Down
1 change: 1 addition & 0 deletions bin/git-cleanup
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
`git fetch -ap`
branches = `git branch --merged main`.split("\n").collect { |b| b.delete('*').strip }

Expand Down
1 change: 1 addition & 0 deletions bin/graph
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# This script creates png images to visualize a Hyrax workflow
# Usage: bin/graph <workflow_name>
Expand Down
1 change: 1 addition & 0 deletions bin/import_from_csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

def validate_hostname!(hostname)
return if hostname
Expand Down
1 change: 1 addition & 0 deletions bin/import_from_purl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

def validate_hostname!(hostname)
return if hostname
Expand Down
1 change: 1 addition & 0 deletions bin/import_mods_files
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

def validate_hostname!(hostname)
return if hostname
Expand Down
1 change: 1 addition & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
1 change: 1 addition & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative '../config/boot'
require 'rake'
Rake.application.run
1 change: 1 addition & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'pathname'
require 'fileutils'
include FileUtils
Expand Down
1 change: 1 addition & 0 deletions bin/spring
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.
Expand Down
1 change: 1 addition & 0 deletions bin/update
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'pathname'
require 'fileutils'
include FileUtils
Expand Down
1 change: 1 addition & 0 deletions bin/web
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/local/bin/ruby
# frozen_string_literal: true
`echo "$GOOGLE_OAUTH_PRIVATE_KEY_VALUE" | base64 -d > prod-cred.p12` if ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'].present?

exec "bundle exec puma -v -b tcp://0.0.0.0:3000"
1 change: 1 addition & 0 deletions bin/worker
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/local/bin/ruby
# frozen_string_literal: true
`echo "$GOOGLE_OAUTH_PRIVATE_KEY_VALUE" | base64 -d > prod-cred.p12` if ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'].present?

if ENV['DATABASE_URL'].present?
Expand Down
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'boot'
require_relative '../app/middleware/no_cache_middleware'

Expand Down
1 change: 1 addition & 0 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
1 change: 1 addition & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Load the Rails application.
require_relative 'application'

Expand Down
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
1 change: 1 addition & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
1 change: 1 addition & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
1 change: 1 addition & 0 deletions config/initializers/0db_created.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
def db_created?
::ActiveRecord::Base.connection_pool.with_connection(&:active?)
rescue
Expand Down
1 change: 1 addition & 0 deletions config/initializers/active_fedora_override.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Based on https://github.com/samvera/hyrax/issues/4581#issuecomment-843085122

# Monkey-patch to short circuit ActiveModel::Dirty which attempts to load the whole master files ordered list when calling nodes_will_change!
Expand Down
1 change: 1 addition & 0 deletions config/initializers/apartment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
if ENV['DB_ADAPTER'] != 'nulldb' && db_created?
# You can have Apartment route to the appropriate Tenant by adding some Rack middleware.
# Apartment can support many different "Elevators" that can take care of this routing to your data.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/apartment_activejob.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'active_job'
require 'active_job_tenant'

Expand Down
1 change: 1 addition & 0 deletions config/initializers/application_controller_renderer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# ApplicationController.renderer.defaults.merge!(
Expand Down
1 change: 1 addition & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/backtrace_silencers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/clamav.rb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# frozen_string_literal: true
ClamAV.instance.loaddb if defined? ClamAV
1 change: 1 addition & 0 deletions config/initializers/cookies_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Specify a serializer for the signed and encrypted cookie jars.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
Expand Down
1 change: 1 addition & 0 deletions config/initializers/file_set_derivatives_overrides.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# This file contains overrides to Hyrax::FileSetDerivativesService to increase the size of thumbnails

# Hyrax v3.5.0
Expand Down
1 change: 1 addition & 0 deletions config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Configure sensitive parameters which will be filtered from the log file.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/hydra_config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# windows doesn't properly require hydra-head (from the gemfile), so we need to require it explicitly here:
require 'hydra/head' unless defined? Hydra

Expand Down
1 change: 1 addition & 0 deletions config/initializers/hyrax.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Set nested indexer to graph by default. Remove after Hyrax 4.0 upgrade
ENV['HYRAX_USE_SOLR_GRAPH_NESTING'].present? || ENV['HYRAX_USE_SOLR_GRAPH_NESTING'] = "true"

Expand Down
1 change: 1 addition & 0 deletions config/initializers/iiif_print.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
IiifPrint.config do |config|
# NOTE: WorkTypes and models are used synonymously here.
# Add models to be excluded from search so the user
Expand Down
1 change: 1 addition & 0 deletions config/initializers/inflections.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Add new inflection rules using the following format. Inflections
Expand Down
1 change: 1 addition & 0 deletions config/initializers/mailboxer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Mailboxer.setup do |config|
# Configures if you application uses or not email sending for Notifications and Messages
config.uses_emails = true
Expand Down
1 change: 1 addition & 0 deletions config/initializers/mime_types.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Add new mime types for use in respond_to blocks:
Expand Down
1 change: 1 addition & 0 deletions config/initializers/mini_magick.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'mini_magick'

MiniMagick.configure do |config|
Expand Down
1 change: 1 addition & 0 deletions config/initializers/new_framework_defaults.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/redis_config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
config = YAML.load(ERB.new(IO.read(Rails.root + 'config' + 'redis.yml')).result)[Rails.env].with_indifferent_access
sentinels = config[:sentinel] && config[:sentinel][:host].present? ? { sentinels: [config[:sentinel]] } : {}
redis_config = config.except(:sentinel).merge(thread_safe: true).merge(sentinels)
Expand Down
1 change: 1 addition & 0 deletions config/initializers/riiif.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Riiif::Image.file_resolver = Riiif::HTTPFileResolver.new
Riiif::Image.info_service = lambda do |id, _file|
# id will look like a path to a pcdm:file
Expand Down
1 change: 1 addition & 0 deletions config/initializers/rolify.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# frozen_string_literal: true
Rolify.configure do |config|
end
1 change: 1 addition & 0 deletions config/initializers/secure_headers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
SecureHeaders::Configuration.default do |config|
config.cookies = {
secure: ActiveRecord::Type::Boolean.new.cast(ENV.fetch('HYKU_SSL_CONFIGURED', false)) || SecureHeaders::OPT_OUT,
Expand Down
1 change: 1 addition & 0 deletions config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: '_hyku_session'
1 change: 1 addition & 0 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
if ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE', 'sidekiq') == 'sidekiq'

config = YAML.load(ERB.new(IO.read(Rails.root + 'config' + 'redis.yml')).result)[Rails.env].with_indifferent_access
Expand Down
1 change: 1 addition & 0 deletions config/initializers/simple_form.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# NOTE: This is a modified version of simple_form's default config file.
# The only changes were to move the input to after the hint and error.

Expand Down
2 changes: 2 additions & 0 deletions config/initializers/simple_form_bootstrap.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# NOTE: This is a modified version of simple_form's default config file.
# The only changes were to move the inputs to after the hints and errors.

Expand Down
2 changes: 2 additions & 0 deletions config/initializers/stats_admin.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# -*- coding: utf-8 -*-
module Hyrax
class StatsAdmin
Expand Down
4 changes: 3 additions & 1 deletion config/initializers/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hyku
VERSION = '5.1.0'.freeze
VERSION = '5.1.0'
end
2 changes: 2 additions & 0 deletions config/initializers/wrap_parameters.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# This file contains settings for ActionController::ParamsWrapper which
Expand Down
1 change: 1 addition & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
Expand Down
1 change: 1 addition & 0 deletions config/spring.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
%w[
.ruby-version
.rbenv-vars
Expand Down
1 change: 1 addition & 0 deletions lib/tasks/rubocop.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
begin
require 'rubocop/rake_task'

Expand Down

0 comments on commit 6859d73

Please sign in to comment.