class Glman::Commands::Config

Public Instance Methods

add(name, params) click to toggle source
# File lib/glman/commands/config.rb, line 29
def add(name, params)
  send("#{name}_conf").add(params)
end
clear(name) click to toggle source
# File lib/glman/commands/config.rb, line 25
def clear(name)
  send("#{name}_conf").clear
end
delete(name, params) click to toggle source
# File lib/glman/commands/config.rb, line 33
def delete(name, params)
  send("#{name}_conf").delete(params)
end
get(name) click to toggle source
# File lib/glman/commands/config.rb, line 21
def get(name)
  send("#{name}_conf").get
end
set(name, hash={}) click to toggle source
# File lib/glman/commands/config.rb, line 17
def set(name, hash={})
  send("#{name}_conf").set(hash)
end
show(params=[]) click to toggle source
# File lib/glman/commands/config.rb, line 11
def show(params=[])
  get_configuration_by_key(params).tap do |conf|
    dp conf.blank? ? "No configuration yet" : conf
  end
end

Private Instance Methods

aliases_conf() click to toggle source
# File lib/glman/commands/config.rb, line 60
def aliases_conf
  @aliases_conf ||= Glman::Commands::Configs::AliasesConfig.new(config_manager: config_manager)
end
get_configuration_by_key(params) click to toggle source
# File lib/glman/commands/config.rb, line 39
def get_configuration_by_key(params)
  return config_manager.get if params.blank?
  return config_manager.get[params.to_sym] unless params.kind_of?(Array)

  conf = config_manager.get
  params.compact.each{ |key| conf = conf[key.to_sym] || {} }
  conf
end
gitlab_conf() click to toggle source
# File lib/glman/commands/config.rb, line 56
def gitlab_conf
  @gitlab_conf ||= Glman::Commands::Configs::GitlabConfig.new(config_manager: config_manager)
end
notify_irc_conf() click to toggle source
# File lib/glman/commands/config.rb, line 52
def notify_irc_conf
  @notify_irc_conf ||= Glman::Commands::Configs::NotifyIrcConfig.new(config_manager: config_manager)
end
users_conf() click to toggle source
# File lib/glman/commands/config.rb, line 48
def users_conf
  @users_conf ||= Glman::Commands::Configs::UsersConfig.new(config_manager: config_manager)
end