Class: Zae::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/zae/settings.rb

Overview

User settings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

Returns a new instance of Settings.



24
25
26
# File 'lib/zae/settings.rb', line 24

def initialize
  @config_folder = xdg_config_folder || zae_config_folder
end

Instance Attribute Details

#config_folderObject (readonly)

user configuration folder location



22
23
24
# File 'lib/zae/settings.rb', line 22

def config_folder
  @config_folder
end

Instance Method Details

#xdg_config_folderObject

XDG configuration localtion



34
35
36
# File 'lib/zae/settings.rb', line 34

def xdg_config_folder
  Pathname.new(File.join(ENV['XDG_CONFIG_HOME'], 'zae')) if ENV['XDG_CONFIG_HOME']
end

#zae_config_folderObject

default configuration location



29
30
31
# File 'lib/zae/settings.rb', line 29

def zae_config_folder
  Pathname.new(File.join(Dir.home, '.config', 'zae'))
end