mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 23:07:28 +08:00
DEV: Rename ServiceRunner
to Service::Runner
for consistency
This commit is contained in:

committed by
Loïc Guitaut

parent
a4ccdeccb3
commit
78d9f9fa40
@ -235,7 +235,7 @@ module Service
|
|||||||
|
|
||||||
def call(context = {}, &actions)
|
def call(context = {}, &actions)
|
||||||
return new(context).tap(&:run).context unless block_given?
|
return new(context).tap(&:run).context unless block_given?
|
||||||
ServiceRunner.call(self, context, &actions)
|
Service::Runner.call(self, context, &actions)
|
||||||
end
|
end
|
||||||
|
|
||||||
def call!(context = {})
|
def call!(context = {})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
#
|
#
|
||||||
# = ServiceRunner
|
# = Service::Runner
|
||||||
#
|
#
|
||||||
# This class is automatically used when passing a block to the `.call` method
|
# This class is automatically used when passing a block to the `.call` method
|
||||||
# of a service. Its main purpose is to ease how actions can be run upon a
|
# of a service. Its main purpose is to ease how actions can be run upon a
|
||||||
@ -53,7 +53,7 @@
|
|||||||
# only exception to this being +on_failure+ as it will always be executed last.
|
# only exception to this being +on_failure+ as it will always be executed last.
|
||||||
#
|
#
|
||||||
|
|
||||||
class ServiceRunner
|
class Service::Runner
|
||||||
# @!visibility private
|
# @!visibility private
|
||||||
AVAILABLE_ACTIONS = {
|
AVAILABLE_ACTIONS = {
|
||||||
on_success: {
|
on_success: {
|
@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
RSpec.describe ServiceRunner do
|
RSpec.describe Service::Runner do
|
||||||
class SuccessService
|
class SuccessService
|
||||||
include Service::Base
|
include Service::Base
|
||||||
end
|
end
|
Reference in New Issue
Block a user