Class: Shoryuken::EnvironmentLoader
- Inherits:
-
Object
- Object
- Shoryuken::EnvironmentLoader
- Defined in:
- lib/shoryuken/environment_loader.rb
Overview
Loads and configures the Shoryuken environment from configuration files and command line options. Handles Rails integration and queue setup.
Instance Attribute Summary collapse
-
#options ⇒ Hash
readonly
The configuration options.
Class Method Summary collapse
-
.load_for_rails_console ⇒ void
Loads the environment for Rails console usage.
-
.setup_options(options) ⇒ Shoryuken::EnvironmentLoader
Sets up a new EnvironmentLoader with the given options.
Instance Method Summary collapse
-
#initialize(options) ⇒ EnvironmentLoader
constructor
Initializes a new EnvironmentLoader with the given options.
-
#load ⇒ void
Loads the environment including queues and workers.
-
#setup_options ⇒ void
Sets up configuration options from file and initializes components.
Constructor Details
#initialize(options) ⇒ EnvironmentLoader
Initializes a new EnvironmentLoader with the given options
43 44 45 |
# File 'lib/shoryuken/environment_loader.rb', line 43 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Hash (readonly)
Returns the configuration options.
8 9 10 |
# File 'lib/shoryuken/environment_loader.rb', line 8 def @options end |
Class Method Details
.load_for_rails_console ⇒ void
This method returns an undefined value.
Loads the environment for Rails console usage
29 30 31 32 |
# File 'lib/shoryuken/environment_loader.rb', line 29 def self.load_for_rails_console instance = (config_file: (Rails.root + 'config' + 'shoryuken.yml')) instance.load end |
.setup_options(options) ⇒ Shoryuken::EnvironmentLoader
Sets up a new EnvironmentLoader with the given options
20 21 22 23 24 |
# File 'lib/shoryuken/environment_loader.rb', line 20 def self.() instance = new() instance. instance end |
Instance Method Details
#load ⇒ void
This method returns an undefined value.
Loads the environment including queues and workers
59 60 61 62 63 64 65 |
# File 'lib/shoryuken/environment_loader.rb', line 59 def load prefix_active_job_queue_names parse_queues require_workers validate_queues validate_workers end |
#setup_options ⇒ void
This method returns an undefined value.
Sets up configuration options from file and initializes components
50 51 52 53 54 |
# File 'lib/shoryuken/environment_loader.rb', line 50 def initialize_rails if load_rails? initialize_logger end |