Module: ConfigModule
- Included in:
- ProjectModule::TakeltauProject, Takeltau::CLI, Takeltau::Docker, Takeltau::DockerCheck, Takeltau::DockerContainer, Takeltau::DockerContainerCheck, Takeltau::DockerImage, Takeltau::DockerImageTag, Takeltau::GitCheck, Takeltau::Hg, Takeltau::InfoProject, Takeltau::InfoStatus, Takeltau::InitPacker, Takeltau::InitTakelage, Takeltau::Mutagen, Takeltau::MutagenCheck, Takeltau::MutagenSocket, Takeltau::SelfConfig, Takeltau::Ship, Takeltau::ShipContainer, Takeltau::ShipContainerCheck, Takeltau::ShipInfo, Takeltau::ShipPorts, Takeltau::ShipProject
- Defined in:
- lib/takeltau/lib/config.rb
Overview
tau config module
Defined Under Namespace
Classes: TakeltauConfig
Instance Method Summary collapse
- 
  
    
      #config  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Global singleton config. 
- 
  
    
      #configured?(config_keys)  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    Check if config keys are configured. 
- 
  
    
      #initialize_config(workdir)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Initialize config rubocop:disable Metrics/AbcSize. 
Instance Method Details
#config ⇒ Object
Returns global singleton config.
| 40 41 42 | # File 'lib/takeltau/lib/config.rb', line 40 def config TakeltauConfig.instance end | 
#configured?(config_keys) ⇒ Boolean
Returns check if config keys are configured.
| 45 46 47 48 49 50 51 52 | # File 'lib/takeltau/lib/config.rb', line 45 def configured?(config_keys) @configured = true config_keys.each do |config_key| next unless _check_key_defined? config_key next unless _check_key_set? config_key end @configured end | 
#initialize_config(workdir) ⇒ Object
Initialize config rubocop:disable Metrics/AbcSize
| 24 25 26 27 28 29 30 31 32 33 34 35 36 | # File 'lib/takeltau/lib/config.rb', line 24 def initialize_config(workdir) project_root_dir = File. _get_project_root_dir workdir log.debug "takelage version: #{Takeltau::VERSION}" log.debug "Current working directory: #{Dir.pwd}" log.debug "Project root directory: #{project_root_dir}" unless project_root_dir.empty? TakeltauConfig.instance.default = _config_read_default project_root_dir TakeltauConfig.instance.home = _config_read_home TakeltauConfig.instance.project = _config_read_project project_root_dir TakeltauConfig.instance.envvars = _config_read_envvars TakeltauConfig.instance.active = _config_merge_active end |