lib/dotfileleader/config.rb
def load_config(options = {})
  # Assume the default location if no
  # command-line location is provided
  if options[:config_file] == nil
    home = ENV['HOME']
    config_file = "#{home}/.dotfileleader.rc"
    puts "Loading default config #{config_file}"
    config = TOML.load_file(config_file)
  else
    puts "Loading #{options[:config_file]}"
    config = TOML.load_file(options[:config_file])
  end

  # If the show_config command is run, print out
  # the config file.
  if options[:show_config] == true
    PP.pp(config)
  end

  return config
end
# Loads TOML formatted config file
# - Assumes a default location of
#   $HOME/.dotfileleader.rc
# - This can be overridden with -c or
#   --config on the command line
Loads TOML formatted config file
Assumes a default location of
$HOME/.dotfileleader.rc
This can be overridden with -c or
config on the command line
Loads TOML formatted config file Assumes a default location of $HOME / . dotfileleader . rc This can be overridden with - c or config on the command line
def load_config(options = {})
  if options[:config_file] == nil
    home = ENV['HOME']
    config_file = "#{home}/.dotfileleader.rc"
    puts "Loading default config #{config_file}"
    config = TOML.load_file(config_file)
  else
    puts "Loading #{options[:config_file]}"
    config = TOML.load_file(options[:config_file])
  end
  if options[:show_config] == true
    PP.pp(config)
  end
  return config
end
def load_config ( options = { } ) if options [ :config_file ] == nil home = ENV [ 'HOME' ] config_file = "#{home}/.dotfileleader.rc" puts "Loading default config #{config_file}" config = TOML . load_file ( config_file ) else puts "Loading #{options[:config_file]}" config = TOML . load_file ( options [ :config_file ] ) end if options [ :show_config ] == true PP . pp ( config ) end return config end
Loads TOML formatted config file
 Assumes a default location of
$HOME/.dotfileleader.rc
 This can be overridden with -c or
config on the command line
Loads TOML formatted config file Assumes a default location of $HOME / . dotfileleader . rc This can be overridden with - c or config on the command line
# Assume the default location if no # command-line location is provided # If the show_config command is run, print out # the config file.
options