Class: NexusAPI::ConfigManager
- Inherits:
- 
      Object
      
        - Object
- NexusAPI::ConfigManager
 
- Defined in:
- lib/nexus_api/config_manager.rb
Instance Method Summary collapse
- #assets_repository ⇒ Object
- #components_repository ⇒ Object
- 
  
    
      #initialize(config_path:)  ⇒ ConfigManager 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of ConfigManager. 
- #maven_repository ⇒ Object
- #npm_repository ⇒ Object
- #pypi_repository ⇒ Object
- #raw_repository ⇒ Object
- #rubygems_repository ⇒ Object
- #search_repository ⇒ Object
- #tag_repository ⇒ Object
- #yum_repository ⇒ Object
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_repository ⇒ Object
| 13 14 15 | # File 'lib/nexus_api/config_manager.rb', line 13 def assets_repository @config['assets'] end | 
#components_repository ⇒ Object
| 17 18 19 | # File 'lib/nexus_api/config_manager.rb', line 17 def components_repository @config['components'] end | 
#maven_repository ⇒ Object
| 29 30 31 | # File 'lib/nexus_api/config_manager.rb', line 29 def maven_repository @config['maven'] end | 
#npm_repository ⇒ Object
| 33 34 35 | # File 'lib/nexus_api/config_manager.rb', line 33 def npm_repository @config['npm'] end | 
#pypi_repository ⇒ Object
| 37 38 39 | # File 'lib/nexus_api/config_manager.rb', line 37 def pypi_repository @config['pypi'] end | 
#raw_repository ⇒ Object
| 41 42 43 | # File 'lib/nexus_api/config_manager.rb', line 41 def raw_repository @config['raw'] end | 
#rubygems_repository ⇒ Object
| 45 46 47 | # File 'lib/nexus_api/config_manager.rb', line 45 def rubygems_repository @config['rubygems'] end | 
#search_repository ⇒ Object
| 21 22 23 | # File 'lib/nexus_api/config_manager.rb', line 21 def search_repository @config['search'] end | 
#tag_repository ⇒ Object
| 25 26 27 | # File 'lib/nexus_api/config_manager.rb', line 25 def tag_repository @config['tag'] end | 
#yum_repository ⇒ Object
| 49 50 51 | # File 'lib/nexus_api/config_manager.rb', line 49 def yum_repository @config['yum'] end |