Class: Proxy::Omaha::ConfigurationLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_proxy_omaha/configuration_loader.rb

Instance Method Summary collapse

Instance Method Details

#load_classesObject



3
4
5
6
7
8
# File 'lib/smart_proxy_omaha/configuration_loader.rb', line 3

def load_classes
  require 'smart_proxy_omaha/dependency_injection'
  require 'smart_proxy_omaha/foreman_client'
  require 'smart_proxy_omaha/omaha_api'
  require 'smart_proxy_omaha/distribution'
end

#load_dependency_injection_wirings(container_instance, settings) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/smart_proxy_omaha/configuration_loader.rb', line 10

def load_dependency_injection_wirings(container_instance, settings)
  container_instance.singleton_dependency :foreman_client_impl, Proxy::Omaha::ForemanClient
  container_instance.singleton_dependency :distribution_impl, (lambda do
    Proxy::Omaha::Distribution.new(settings[:distribution])
  end)
  container_instance.singleton_dependency :release_repository_impl, (lambda do
    Proxy::Omaha::ReleaseRepository.new(
      :contentpath => settings[:contentpath],
      :distribution => container_instance.get_dependency(:distribution_impl)
    )
  end)
  container_instance.singleton_dependency :metadata_provider_impl, (lambda do
    Proxy::Omaha::MetadataProvider.new(:contentpath => settings[:contentpath])
  end)
end