Class: Zae::Settings
- Inherits:
-
Object
- Object
- Zae::Settings
- Defined in:
- lib/zae/settings.rb
Overview
User settings
Instance Attribute Summary collapse
-
#config_folder ⇒ Object
readonly
user configuration folder location.
Instance Method Summary collapse
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
-
#xdg_config_folder ⇒ Object
XDG configuration localtion.
-
#zae_config_folder ⇒ Object
default configuration location.
Constructor Details
#initialize ⇒ Settings
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_folder ⇒ Object (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_folder ⇒ Object
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_folder ⇒ Object
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 |