From 1c9e78fe394f38f5615e05d2034f9c7f40911b16 Mon Sep 17 00:00:00 2001 From: Chris Welham <71787007+apexatoll@users.noreply.github.com> Date: Sun, 1 Oct 2023 23:06:13 +0100 Subject: [PATCH] Rename base configurator --- lib/kangaru/configurators.rb | 2 +- .../configurators/{base_configurator.rb => configurator.rb} | 2 +- sig/kangaru/config.rbs | 2 +- sig/kangaru/configurators.rbs | 2 +- .../configurators/{base_configurator.rbs => configurator.rbs} | 2 +- spec/kangaru/config_spec.rb | 4 ++-- .../{base_configurator_spec.rb => configurator_spec.rb} | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) rename lib/kangaru/configurators/{base_configurator.rb => configurator.rb} (95%) rename sig/kangaru/configurators/{base_configurator.rbs => configurator.rbs} (88%) rename spec/kangaru/configurators/{base_configurator_spec.rb => configurator_spec.rb} (96%) diff --git a/lib/kangaru/configurators.rb b/lib/kangaru/configurators.rb index 4b5a5eb..576edf1 100644 --- a/lib/kangaru/configurators.rb +++ b/lib/kangaru/configurators.rb @@ -3,7 +3,7 @@ module Configurators def self.classes constants.map { |constant| const_get(constant) } .select { |constant| constant.is_a?(Class) } - .reject { |constant| constant == BaseConfigurator } + .reject { |constant| constant == Configurator } end end end diff --git a/lib/kangaru/configurators/base_configurator.rb b/lib/kangaru/configurators/configurator.rb similarity index 95% rename from lib/kangaru/configurators/base_configurator.rb rename to lib/kangaru/configurators/configurator.rb index c128570..866d704 100644 --- a/lib/kangaru/configurators/base_configurator.rb +++ b/lib/kangaru/configurators/configurator.rb @@ -1,6 +1,6 @@ module Kangaru module Configurators - class BaseConfigurator + class Configurator using Patches::Inflections def self.name diff --git a/sig/kangaru/config.rbs b/sig/kangaru/config.rbs index 0162442..11905be 100644 --- a/sig/kangaru/config.rbs +++ b/sig/kangaru/config.rbs @@ -1,6 +1,6 @@ module Kangaru class Config - type configurator = Configurators::BaseConfigurator + type configurator = Configurators::Configurator attr_reader configurators: Hash[Symbol, configurator] diff --git a/sig/kangaru/configurators.rbs b/sig/kangaru/configurators.rbs index 936fba1..ceb0c26 100644 --- a/sig/kangaru/configurators.rbs +++ b/sig/kangaru/configurators.rbs @@ -1,5 +1,5 @@ module Kangaru module Configurators - def self.classes: -> Array[singleton(BaseConfigurator)] + def self.classes: -> Array[singleton(Configurator)] end end diff --git a/sig/kangaru/configurators/base_configurator.rbs b/sig/kangaru/configurators/configurator.rbs similarity index 88% rename from sig/kangaru/configurators/base_configurator.rbs rename to sig/kangaru/configurators/configurator.rbs index e2b73ac..7343089 100644 --- a/sig/kangaru/configurators/base_configurator.rbs +++ b/sig/kangaru/configurators/configurator.rbs @@ -1,6 +1,6 @@ module Kangaru module Configurators - class BaseConfigurator + class Configurator self.@settings: Array[Symbol] def self.name: -> Symbol diff --git a/spec/kangaru/config_spec.rb b/spec/kangaru/config_spec.rb index 6f5696c..52f1ebd 100644 --- a/spec/kangaru/config_spec.rb +++ b/spec/kangaru/config_spec.rb @@ -21,12 +21,12 @@ after { described_class.undef_method(name) } let(:configurator_class) do - class_spy(Kangaru::Configurators::BaseConfigurator, name:) + class_spy(Kangaru::Configurators::Configurator, name:) end let(:configurator) do instance_spy( - Kangaru::Configurators::BaseConfigurator, + Kangaru::Configurators::Configurator, serialise: configurator_hash ) end diff --git a/spec/kangaru/configurators/base_configurator_spec.rb b/spec/kangaru/configurators/configurator_spec.rb similarity index 96% rename from spec/kangaru/configurators/base_configurator_spec.rb rename to spec/kangaru/configurators/configurator_spec.rb index cafe40a..2a9c20b 100644 --- a/spec/kangaru/configurators/base_configurator_spec.rb +++ b/spec/kangaru/configurators/configurator_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe Kangaru::Configurators::BaseConfigurator do +RSpec.describe Kangaru::Configurators::Configurator do describe ".name" do subject(:name) { configurator_class.name }