From 78d9f9fa40bd921ec9300d87b03d957c952d4fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guitaut?= Date: Thu, 19 Sep 2024 17:52:44 +0200 Subject: [PATCH] DEV: Rename `ServiceRunner` to `Service::Runner` for consistency --- lib/service/base.rb | 2 +- lib/{service_runner.rb => service/runner.rb} | 4 ++-- spec/lib/{service_runner_spec.rb => service/runner_spec.rb} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename lib/{service_runner.rb => service/runner.rb} (99%) rename spec/lib/{service_runner_spec.rb => service/runner_spec.rb} (99%) diff --git a/lib/service/base.rb b/lib/service/base.rb index a73b11ba527..cb7f38d5498 100644 --- a/lib/service/base.rb +++ b/lib/service/base.rb @@ -235,7 +235,7 @@ module Service def call(context = {}, &actions) return new(context).tap(&:run).context unless block_given? - ServiceRunner.call(self, context, &actions) + Service::Runner.call(self, context, &actions) end def call!(context = {}) diff --git a/lib/service_runner.rb b/lib/service/runner.rb similarity index 99% rename from lib/service_runner.rb rename to lib/service/runner.rb index a18593f7fe4..148ab0119db 100644 --- a/lib/service_runner.rb +++ b/lib/service/runner.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# = ServiceRunner +# = Service::Runner # # 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 @@ -53,7 +53,7 @@ # only exception to this being +on_failure+ as it will always be executed last. # -class ServiceRunner +class Service::Runner # @!visibility private AVAILABLE_ACTIONS = { on_success: { diff --git a/spec/lib/service_runner_spec.rb b/spec/lib/service/runner_spec.rb similarity index 99% rename from spec/lib/service_runner_spec.rb rename to spec/lib/service/runner_spec.rb index e9dec57c8dc..1d8cd6680bb 100644 --- a/spec/lib/service_runner_spec.rb +++ b/spec/lib/service/runner_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe ServiceRunner do +RSpec.describe Service::Runner do class SuccessService include Service::Base end