Class: NexusAPI::ConfigManager

Inherits:
Object
  • Object
show all
Defined in:
lib/nexus_api/config_manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_path:) ⇒ ConfigManager

Returns a new instance of ConfigManager.



5
6
7
8
9
10
11
# File 'lib/nexus_api/config_manager.rb', line 5

def initialize(config_path:)
  if File.exist?(config_path)
    @config = YAML.safe_load(File.read(config_path)) || {}
  else
    raise "ERROR: Specified config '#{config_path}' does not exist."
  end
end

Instance Method Details

#assets_repositoryObject



13
14
15
# File 'lib/nexus_api/config_manager.rb', line 13

def assets_repository
  @config['assets']
end

#components_repositoryObject



17
18
19
# File 'lib/nexus_api/config_manager.rb', line 17

def components_repository
  @config['components']
end

#maven_repositoryObject



29
30
31
# File 'lib/nexus_api/config_manager.rb', line 29

def maven_repository
  @config['maven']
end

#npm_repositoryObject



33
34
35
# File 'lib/nexus_api/config_manager.rb', line 33

def npm_repository
  @config['npm']
end

#pypi_repositoryObject



37
38
39
# File 'lib/nexus_api/config_manager.rb', line 37

def pypi_repository
  @config['pypi']
end

#raw_repositoryObject



41
42
43
# File 'lib/nexus_api/config_manager.rb', line 41

def raw_repository
  @config['raw']
end

#rubygems_repositoryObject



45
46
47
# File 'lib/nexus_api/config_manager.rb', line 45

def rubygems_repository
  @config['rubygems']
end

#search_repositoryObject



21
22
23
# File 'lib/nexus_api/config_manager.rb', line 21

def search_repository
  @config['search']
end

#tag_repositoryObject



25
26
27
# File 'lib/nexus_api/config_manager.rb', line 25

def tag_repository
  @config['tag']
end

#yum_repositoryObject



49
50
51
# File 'lib/nexus_api/config_manager.rb', line 49

def yum_repository
  @config['yum']
end