class Helpers::BusbarConfig
Constants
- CONFIG_OPTIONS
Public Class Methods
create_empty_config_file()
click to toggle source
# File lib/busbar_cli/helpers/busbar_config.rb, line 33 def create_empty_config_file busbar_config_hash = {} ensure_dependencies CONFIG_OPTIONS.each do |k, _| busbar_config_hash[k.to_s] = nil end File.open(BUSBAR_CONFIG_FILE_PATH, 'w') { |f| f.write(busbar_config_hash.to_yaml) } end
ensure_dependencies()
click to toggle source
# File lib/busbar_cli/helpers/busbar_config.rb, line 29 def ensure_dependencies FileUtils.mkdir_p(BUSBAR_LOCAL_FOLDER) unless Dir.exist?(BUSBAR_LOCAL_FOLDER) end
write_from_hash(busbar_config_hash, first_run)
click to toggle source
# File lib/busbar_cli/helpers/busbar_config.rb, line 42 def write_from_hash(busbar_config_hash, first_run) # Pre-Validate busbar_config_hash.each do |k, v| Services::Kube.validate_profile(v) if k == 'busbar_profile' unless first_run end # Write busbar_config_hash.each do |k, v| Services::BusbarConfig.set(k.to_s, v) end end