Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions lib/temporal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -75,9 +74,6 @@ def default_client
@default_client ||= Client.new(config)
end

def config
@config ||= Configuration.new
end
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not removed, hoisted out of private ⬆️


end
end
2 changes: 1 addition & 1 deletion lib/temporal/testing/local_workflow_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/temporal/testing/replay_tester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ReplayError < StandardError
end

class ReplayTester
def initialize(config: Temporal.configuration)
def initialize(config: Temporal.config)
@config = config
end

Expand Down
2 changes: 1 addition & 1 deletion lib/temporal/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
10 changes: 3 additions & 7 deletions spec/unit/lib/temporal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down