Class: Shoryuken::EnvironmentLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/shoryuken/environment_loader.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ EnvironmentLoader

Returns a new instance of EnvironmentLoader


13
14
15
# File 'lib/shoryuken/environment_loader.rb', line 13

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options


3
4
5
# File 'lib/shoryuken/environment_loader.rb', line 3

def options
  @options
end

Class Method Details

.load(options) ⇒ Object


5
6
7
# File 'lib/shoryuken/environment_loader.rb', line 5

def self.load(options)
  new(options).load
end

.load_for_rails_consoleObject


9
10
11
# File 'lib/shoryuken/environment_loader.rb', line 9

def self.load_for_rails_console
  load(config_file: (Rails.root + 'config' + 'shoryuken.yml'))
end

Instance Method Details

#loadObject


17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/shoryuken/environment_loader.rb', line 17

def load
  initialize_logger
  load_rails if options[:rails]
  Shoryuken.options.merge!(config_file_options)
  merge_cli_defined_queues
  prefix_active_job_queue_names
  Shoryuken.options.merge!(options)
  parse_queues
  require_workers
  initialize_aws
  validate_queues
  validate_workers
  patch_deprecated_workers
end