Module: TabTab::LocalConfig

Included in:
InstallTabTab::CLI, CLI
Defined in:
lib/tabtab/local_config.rb

Instance Method Summary collapse

Instance Method Details

#configObject



4
5
6
7
8
9
10
# File 'lib/tabtab/local_config.rb', line 4

def config
  @config ||= begin
    config_file = File.join(home, '.tabtab.yml')
    return {} unless File.exists?(config_file)
    YAML.load(File.read(config_file))
  end
end

#homeObject



12
13
14
# File 'lib/tabtab/local_config.rb', line 12

def home
  ENV["HOME"] || ENV["HOMEPATH"] || File::expand_path("~")
end