Module: Appom::Configuration
- Defined in:
- lib/appom/configuration.rb
Overview
Configuration management for Appom automation framework Handles loading and parsing of YAML configuration files with environment support
Defined Under Namespace
Classes: Config, ConfigSchema
Class Attribute Summary collapse
Class Method Summary collapse
-
.apply_to_appom ⇒ Object
Apply configuration values to Appom modules.
-
.configure(config_data = nil) ⇒ Object
Configure Appom with block or hash.
-
.get(key_path, default = nil) ⇒ Object
Get configuration value using dot notation.
-
.load_from_file(file_path, environment: nil) ⇒ Config
Load configuration from file.
-
.set(key_path, value) ⇒ Object
Set configuration value using dot notation.
Class Attribute Details
.config ⇒ Object
401 402 403 |
# File 'lib/appom/configuration.rb', line 401 def config @config ||= Config.new end |
Class Method Details
.apply_to_appom ⇒ Object
Apply configuration values to Appom modules
434 435 436 437 438 439 |
# File 'lib/appom/configuration.rb', line 434 def apply_to_appom configure_appom_wait_time configure_appom_logging configure_appom_caching configure_appom_screenshots end |
.configure(config_data = nil) ⇒ Object
Configure Appom with block or hash
406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/appom/configuration.rb', line 406 def configure(config_data = nil, &) if block_given? yield config elsif config_data config.merge!(config_data) end # Apply configuration to Appom apply_to_appom config end |
.get(key_path, default = nil) ⇒ Object
Get configuration value using dot notation
448 449 450 |
# File 'lib/appom/configuration.rb', line 448 def get(key_path, default = nil) config.get(key_path, default) end |
.load_from_file(file_path, environment: nil) ⇒ Config
Load configuration from file
427 428 429 430 431 |
# File 'lib/appom/configuration.rb', line 427 def load_from_file(file_path, environment: nil) @config = Config.new(config_file: file_path, environment: environment) apply_to_appom @config end |
.set(key_path, value) ⇒ Object
Set configuration value using dot notation
457 458 459 |
# File 'lib/appom/configuration.rb', line 457 def set(key_path, value) config.set(key_path, value) end |