module

Azu

Constants

CONFIG = Configuration.new
ERROR_REPORTER = ErrorReporter.new

Global error reporter instance

Class methods

cache

Rails-like cache API

Source
clear_fiber_configs

Clear all fiber-local configurations

Useful for cleanup in test suites.

Source
current_config

Get the current configuration

Returns fiber-local configuration if set, otherwise returns the global CONFIG. This allows tests to run with isolated configurations without affecting other fibers or the global state.

Example:

# Get current config
current = Azu.current_config
puts current.env # => "development"
Source
with_config(config : Configuration, &)

Execute a block with a custom configuration

This is primarily useful for testing, allowing tests to run with isolated configuration without affecting other tests or the global state.

Example:

test_config = Azu::Configuration.new
test_config.env = Azu::Environment::Test

Azu.with_config(test_config) do
  # Code here uses test_config
  Azu.current_config.env # => Environment::Test
end
# Outside the block, global CONFIG is used again
Source

Nested types