Skip to content

Commit 7f21c9e

Browse files
committed
fix: Enable frozen_string_literal
1 parent f6459b3 commit 7f21c9e

File tree

122 files changed

+239
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+239
-5
lines changed

.rubocop.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ Style/Documentation:
6464
Enabled: false
6565
Style/EmptyMethod:
6666
EnforcedStyle: expanded
67-
Style/FrozenStringLiteralComment:
68-
Enabled: false
6967
Style/RescueStandardError:
7068
EnforcedStyle: implicit
7169
Style/StringLiterals:

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24
git_source(:github) {|repo| "https://github.com/#{repo}.git"}
35

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Add your own tasks in files placed in lib/tasks ending in .rake,
24
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
35

app/controllers/application_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationController < ActionController::Base
24
before_action :set_locale
35
rescue_from CanCan::AccessDenied do

app/controllers/channel_lists/search_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ChannelLists
24
class SearchController < ChannelListsController
35
def index

app/controllers/channel_lists/subscriptions_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ChannelLists
24
class SubscriptionsController < ChannelListsController
35
def index

app/controllers/channel_lists_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ChannelListsController < ApplicationController
24
private
35

app/controllers/channels/tags_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Channels
24
class TagsController < ApplicationController
35
before_action :set_channel

app/controllers/channels_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ChannelsController < ApplicationController
24
helper_method :sort_column, :sort_direction
35

app/controllers/system_settings_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class SystemSettingsController < ApplicationController
24
include SystemSettingAware
35

app/controllers/tags_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class TagsController < ApplicationController
24
def index
35
tags = ActsAsTaggableOn::Tag.named_like(params[:tag_name] || '').order(:name).pluck(:name)

app/helpers/application_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ApplicationHelper
24
def render_notices
35
render partial: 'partials/notices'

app/jobs/channels/build_all_statistics_job.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Channels
24
class BuildAllStatisticsJob
35
@queue = :normal

app/jobs/channels/build_statistics_job.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Channels
24
class BuildStatisticsJob
35
@queue = :normal

app/jobs/channels/update_all_snippets_job.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Channels
24
class UpdateAllSnippetsJob
35
@queue = :normal

app/jobs/channels/update_snippet_job.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Channels
24
class UpdateSnippetJob
35
@queue = :normal

app/lib/channel_tag/parse_error.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ChannelTag
24
class ParseError < StandardError
35
DEFAULT_MESSAGE = <<~MSG.strip.freeze

app/lib/channel_tag/parser.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ChannelTag
24
class Parser < ActsAsTaggableOn::GenericParser
35
def parse

app/lib/consts.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Consts
24
module Statuses
35
STATUS = {

app/mailers/application_mailer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationMailer < ActionMailer::Base
24
default from: '[email protected]'
35
layout 'mailer'

app/mailers/job_failure_notice_mailer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class JobFailureNoticeMailer < ApplicationMailer
24
def alert
35
to = params.fetch(:to)

app/models/ability.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class Ability
24
include CanCan::Ability
35

app/models/application_record.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationRecord < ActiveRecord::Base
24
self.abstract_class = true
35

app/models/channel.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class Channel < ApplicationRecord
24
include SystemSettingAware
35
extend SystemSettingAware

app/models/channel_list.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ChannelList
24
attr_accessor :channels, :next_page_token, :prev_page_token, :total_results
35

app/models/channel_lists/search.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ChannelLists
24
class Search < ChannelList
35
extend SystemSettingAware

app/models/channel_lists/subscription.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ChannelLists
24
class Subscription < ChannelList
35
extend SystemSettingAware

app/models/channel_snippet.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ChannelSnippet < ApplicationRecord
24
belongs_to :channel, inverse_of: :channel_snippets
35
end

app/models/channel_statistic.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ChannelStatistic < ApplicationRecord
24
belongs_to :channel, inverse_of: :channel_statistics
35

app/models/concerns/system_setting_aware.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module SystemSettingAware
24
extend ActiveSupport::Concern
35

app/models/search/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Search
24
class Base
35
include ActiveModel::Model

app/models/search/channel.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Search
24
class Channel < Search::Base
35
attr_accessor :ids, :title, :tag

app/models/search/channel_list_condition.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Search
24
class ChannelListCondition < Search::Base
35
attr_accessor :query, :token

app/models/system_setting.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class SystemSetting < ApplicationRecord
24
include Encryptor
35
include Mishina::Youtube::Oauth2Factory

app/models/user.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class User < ApplicationRecord
24
# Include default devise modules. Others available are:
35
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# frozen_string_literal: true
2+
13
json.extract! channel, :id, :channel_id, :title, :description, :thumbnail_url, :created_at, :updated_at
24
json.url channel_url(channel, format: :json)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
json.array! @channels, partial: 'channels/channel', as: :channel

app/views/channels/show.json.jbuilder

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
json.partial! 'channels/channel', channel: @channel
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# frozen_string_literal: true
2+
13
json.extract! system_setting, :id, :api_key, :created_at, :updated_at
24
json.url system_setting_url(system_setting, format: :json)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
json.partial! 'system_settings/system_setting', system_setting: @system_setting

bin/bundle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
35
load Gem.bin_path('bundler', 'bundle')

bin/importmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
require_relative '../config/application'
45
require 'importmap/commands'

bin/rails

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
APP_PATH = File.expand_path('../config/application', __dir__)
35
require_relative '../config/boot'
46
require 'rails/commands'

bin/rake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
require_relative '../config/boot'
35
require 'rake'
46
Rake.application.run

bin/setup

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
require 'fileutils'
35

46
# path to your application root.

bin/yarn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
APP_ROOT = File.expand_path('..', __dir__)
35
Dir.chdir(APP_ROOT) do
46
yarn = ENV['PATH'].split(File::PATH_SEPARATOR)

config.ru

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# This file is used by Rack-based servers to start the application.
24

35
require_relative 'config/environment'

config/application.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require_relative 'boot'
24

35
require 'rails'

config/boot.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
24

35
require 'bundler/setup' # Set up gems listed in the Gemfile.

config/environment.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Load the Rails application.
24
require_relative 'application'
35

config/environments/development.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'active_support/core_ext/integer/time'
24

35
Rails.application.configure do

config/environments/production.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'active_support/core_ext/integer/time'
24

35
Rails.application.configure do

config/environments/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'active_support/core_ext/integer/time'
24

35
# The test environment is used exclusively to run your application's

config/importmap.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Pin npm packages by running ./bin/importmap
24

35
pin "application", preload: true

config/initializers/action_mailer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
yml_path = Rails.root.join('config/mail.yml')
24
if File.exist?(yml_path)
35
options = YAML.safe_load_file(yml_path, aliases: true)[Rails.env]

config/initializers/application_controller_renderer.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
# Be sure to restart your server when you modify this file.
23

34
# ActiveSupport::Reloader.to_prepare do

config/initializers/backtrace_silencers.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Be sure to restart your server when you modify this file.
24

35
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.

config/initializers/content_security_policy.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
# Be sure to restart your server when you modify this file.
23

34
# Define an application-wide content security policy

config/initializers/cookies_serializer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Be sure to restart your server when you modify this file.
24

35
# Specify a serializer for the signed and encrypted cookie jars.

config/initializers/filter_parameter_logging.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Be sure to restart your server when you modify this file.
24

35
# Configure sensitive parameters which will be filtered from the log file.

config/initializers/generators.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
Rails.application.config.generators.stylesheets = false
24
Rails.application.config.generators.javascripts = false
35
Rails.application.config.generators.helper = false

config/initializers/inflections.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
# Be sure to restart your server when you modify this file.
23

34
# Add new inflection rules using the following format. Inflections

config/initializers/kaminari_config.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
Kaminari.configure do |config|
24
config.default_per_page = 15
35
# config.max_per_page = nil

config/initializers/locale.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
I18n.config.available_locales = [:ja, :en]
24
I18n.enforce_available_locales = true
35
I18n.default_locale = :ja

config/initializers/mime_types.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
# Be sure to restart your server when you modify this file.
23

34
# Add new mime types for use in respond_to blocks:

config/initializers/permissions_policy.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
# Define an application-wide HTTP permissions policy. For further
23
# information see https://developers.google.com/web/updates/2018/06/feature-policy
34
#

config/initializers/rack_profiler.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
if Rails.env.development?
24
require 'rack-mini-profiler'
35

0 commit comments

Comments
 (0)