diff --git a/lib/temporal.rb b/lib/temporal.rb index b9f49d55..b35023fd 100644 --- a/lib/temporal.rb +++ b/lib/temporal.rb @@ -56,9 +56,8 @@ def configure(&block) @default_client = nil end - def configuration - warn '[DEPRECATION] This method is now deprecated without a substitution' - config + def config + @config ||= Configuration.new end def logger @@ -75,9 +74,6 @@ def default_client @default_client ||= Client.new(config) end - def config - @config ||= Configuration.new - end end end diff --git a/lib/temporal/testing/local_workflow_context.rb b/lib/temporal/testing/local_workflow_context.rb index 7d3321ae..cf9352ad 100644 --- a/lib/temporal/testing/local_workflow_context.rb +++ b/lib/temporal/testing/local_workflow_context.rb @@ -12,7 +12,7 @@ module Testing class LocalWorkflowContext attr_reader :metadata, :config - def initialize(execution, workflow_id, run_id, disabled_releases, metadata, config = Temporal.configuration) + def initialize(execution, workflow_id, run_id, disabled_releases, metadata, config = Temporal.config) @last_event_id = 0 @execution = execution @run_id = run_id diff --git a/lib/temporal/testing/replay_tester.rb b/lib/temporal/testing/replay_tester.rb index 6a98c86e..9a2724c0 100644 --- a/lib/temporal/testing/replay_tester.rb +++ b/lib/temporal/testing/replay_tester.rb @@ -12,7 +12,7 @@ class ReplayError < StandardError end class ReplayTester - def initialize(config: Temporal.configuration) + def initialize(config: Temporal.config) @config = config end diff --git a/lib/temporal/worker.rb b/lib/temporal/worker.rb index e9a3b2f3..9d73fb93 100644 --- a/lib/temporal/worker.rb +++ b/lib/temporal/worker.rb @@ -33,7 +33,7 @@ class Worker # to be executed once every 10 seconds. This can be used to protect down stream services from # flooding. The zero value of this uses the default value. Default is unlimited. def initialize( - config = Temporal.configuration, + config = Temporal.config, activity_thread_pool_size: Temporal::Activity::Poller::DEFAULT_OPTIONS[:thread_pool_size], workflow_thread_pool_size: Temporal::Workflow::Poller::DEFAULT_OPTIONS[:thread_pool_size], binary_checksum: Temporal::Workflow::Poller::DEFAULT_OPTIONS[:binary_checksum], diff --git a/spec/unit/lib/temporal_spec.rb b/spec/unit/lib/temporal_spec.rb index 49e57664..c2f9494c 100644 --- a/spec/unit/lib/temporal_spec.rb +++ b/spec/unit/lib/temporal_spec.rb @@ -71,14 +71,10 @@ end end - describe '.configuration' do - before { allow(described_class).to receive(:warn) } + describe '.config' do - it 'returns Temporal::Configuration object' do - expect(described_class.configuration).to be_an_instance_of(Temporal::Configuration) - expect(described_class) - .to have_received(:warn) - .with('[DEPRECATION] This method is now deprecated without a substitution') + it 'returns configured Temporal::Configuration object' do + expect(described_class.config).to be_an_instance_of(Temporal::Configuration) end end