Commit 0cf45deb authored by gfyoung's avatar gfyoung

Enable more frozen string in app/services/**/*.rb

Partially addresses #47424.
parent 1df32177
# frozen_string_literal: true
module Prometheus module Prometheus
class AdapterService class AdapterService
def initialize(project, deployment_platform = nil) def initialize(project, deployment_platform = nil)
......
# frozen_string_literal: true
module ProtectedBranches module ProtectedBranches
class AccessLevelParams class AccessLevelParams
attr_reader :type, :params attr_reader :type, :params
......
# frozen_string_literal: true
module ProtectedBranches module ProtectedBranches
class ApiService < BaseService class ApiService < BaseService
def create def create
......
# frozen_string_literal: true
module ProtectedBranches module ProtectedBranches
class CreateService < BaseService class CreateService < BaseService
def execute(skip_authorization: false) def execute(skip_authorization: false)
......
# frozen_string_literal: true
module ProtectedBranches module ProtectedBranches
class DestroyService < BaseService class DestroyService < BaseService
def execute(protected_branch) def execute(protected_branch)
......
# frozen_string_literal: true
# The branches#protect API still uses the `developers_can_push` and `developers_can_merge` # The branches#protect API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the # flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so # internal data model (separate access levels). The translation code is non-trivial, and so
......
# frozen_string_literal: true
# The branches#protect API still uses the `developers_can_push` and `developers_can_merge` # The branches#protect API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the # flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so # internal data model (separate access levels). The translation code is non-trivial, and so
......
# frozen_string_literal: true
module ProtectedBranches module ProtectedBranches
class UpdateService < BaseService class UpdateService < BaseService
def execute(protected_branch) def execute(protected_branch)
......
# frozen_string_literal: true
module ProtectedTags module ProtectedTags
class CreateService < BaseService class CreateService < BaseService
attr_reader :protected_tag attr_reader :protected_tag
......
# frozen_string_literal: true
module ProtectedTags module ProtectedTags
class DestroyService < BaseService class DestroyService < BaseService
def execute(protected_tag) def execute(protected_tag)
......
# frozen_string_literal: true
module ProtectedTags module ProtectedTags
class UpdateService < BaseService class UpdateService < BaseService
def execute(protected_tag) def execute(protected_tag)
......
# frozen_string_literal: true
module QuickActions module QuickActions
class InterpretService < BaseService class InterpretService < BaseService
include Gitlab::QuickActions::Dsl include Gitlab::QuickActions::Dsl
......
# frozen_string_literal: true
module Search module Search
class GlobalService class GlobalService
attr_accessor :current_user, :params attr_accessor :current_user, :params
......
# frozen_string_literal: true
module Search module Search
class GroupService < Search::GlobalService class GroupService < Search::GlobalService
attr_accessor :group attr_accessor :group
......
# frozen_string_literal: true
module Search module Search
class ProjectService class ProjectService
attr_accessor :project, :current_user, :params attr_accessor :project, :current_user, :params
......
# frozen_string_literal: true
module Search module Search
class SnippetService class SnippetService
attr_accessor :current_user, :params attr_accessor :current_user, :params
......
# frozen_string_literal: true
module Tags module Tags
class CreateService < BaseService class CreateService < BaseService
def execute(tag_name, target, message, release_description = nil) def execute(tag_name, target, message, release_description = nil)
......
# frozen_string_literal: true
module Tags module Tags
class DestroyService < BaseService class DestroyService < BaseService
def execute(tag_name) def execute(tag_name)
......
# frozen_string_literal: true
module TestHooks module TestHooks
class BaseService class BaseService
attr_accessor :hook, :current_user, :trigger attr_accessor :hook, :current_user, :trigger
......
# frozen_string_literal: true
module TestHooks module TestHooks
class ProjectService < TestHooks::BaseService class ProjectService < TestHooks::BaseService
attr_writer :project attr_writer :project
......
# frozen_string_literal: true
module TestHooks module TestHooks
class SystemService < TestHooks::BaseService class SystemService < TestHooks::BaseService
private private
......
# frozen_string_literal: true
module Users module Users
class ActivityService class ActivityService
def initialize(author, activity) def initialize(author, activity)
......
# frozen_string_literal: true
module Users module Users
class BuildService < BaseService class BuildService < BaseService
def initialize(current_user, params = {}) def initialize(current_user, params = {})
......
# frozen_string_literal: true
module Users module Users
class CreateService < BaseService class CreateService < BaseService
include NewUserNotifier include NewUserNotifier
......
# frozen_string_literal: true
module Users module Users
class DestroyService class DestroyService
attr_accessor :current_user attr_accessor :current_user
......
# frozen_string_literal: true
module Users module Users
# Service class for caching and retrieving the last push event of a user. # Service class for caching and retrieving the last push event of a user.
class LastPushEventService class LastPushEventService
......
# frozen_string_literal: true
# When a user is destroyed, some of their associated records are # When a user is destroyed, some of their associated records are
# moved to a "Ghost User", to prevent these associated records from # moved to a "Ghost User", to prevent these associated records from
# being destroyed. # being destroyed.
......
# frozen_string_literal: true
module Users module Users
# Service for refreshing the authorized projects of a user. # Service for refreshing the authorized projects of a user.
# #
......
# frozen_string_literal: true
module Users module Users
class RespondToTermsService class RespondToTermsService
def initialize(user, term) def initialize(user, term)
......
# frozen_string_literal: true
module Users module Users
class UpdateService < BaseService class UpdateService < BaseService
include NewUserNotifier include NewUserNotifier
......
# frozen_string_literal: true
module WikiPages module WikiPages
class BaseService < ::BaseService class BaseService < ::BaseService
private private
......
# frozen_string_literal: true
module WikiPages module WikiPages
class CreateService < WikiPages::BaseService class CreateService < WikiPages::BaseService
def execute def execute
......
# frozen_string_literal: true
module WikiPages module WikiPages
class DestroyService < WikiPages::BaseService class DestroyService < WikiPages::BaseService
def execute(page) def execute(page)
......
# frozen_string_literal: true
module WikiPages module WikiPages
class UpdateService < WikiPages::BaseService class UpdateService < WikiPages::BaseService
def execute(page) def execute(page)
......
---
title: Enable even more frozen string in app/services/**/*.rb
merge_request: 20702
author: gfyoung
type: performance
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment