Azu
Constants
CONFIG = Configuration.new
ERROR_REPORTER = ErrorReporter.new
Global error reporter instance
Class methods
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"
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
Nested types
- Azu::AssetConfiguration
- Azu::AsyncLogging
- Azu::Cache
- Azu::CachedEnvironment
- Azu::Channel
- Azu::Component
- Azu::ComponentRegistry
- Azu::Components
- Azu::Configuration
- Azu::DevelopmentTools
- Azu::Endpoint(Request, Response)
- Azu::Environment
- Azu::ErrorContext
- Azu::ErrorReport
- Azu::ErrorReporter
- Azu::ExceptionPage
- Azu::Handler
- Azu::HandlerPipeline
- Azu::Helpers
- Azu::I18nConfiguration
- Azu::JsonPerformanceReporter
- Azu::LogPerformanceReporter
- Azu::Markup
- Azu::Params(Request)
- Azu::PerformanceMetrics
- Azu::PerformanceMonitoringManager
- Azu::PerformanceReportScheduler
- Azu::PerformanceReportService
- Azu::PerformanceReporter
- Azu::Request
- Azu::Response
- Azu::Router
- Azu::Spark
- Azu::Templates
- Azu::UploadConfiguration
- Azu::Validator