Module: Ronin::Support::Home
- Defined in:
- lib/ronin/support/home.rb
Overview
Represents the user's home directory.
Constant Summary collapse
- DIR =
Path to the user's home directory.
Gem.user_home
- CACHE_DIR =
Path to the user's
~/.cache/
directory. ENV.fetch('XDG_CACHE_HOME') do File.join(DIR,'.cache') end
- CONFIG_DIR =
Path to the user's
~/.config/
directory. ENV.fetch('XDG_CONFIG_HOME') do File.join(DIR,'.config') end
- LOCAL_SHARE_DIR =
Path to the user's
~/.local/share
directory. ENV.fetch('XDG_DATA_HOME') do File.join(DIR,'.local','share') end
Class Method Summary collapse
-
.cache_dir(subdir) ⇒ String
Returns the path to the sub-directory within the
~/.cache/
directory. -
.config_dir(subdir) ⇒ String
Returns the path to the sub-directory within the
~/.config/
directory. -
.local_share_dir(subdir) ⇒ String
Returns the path to the sub-directory within the
~/.local/share/
directory.
Class Method Details
.cache_dir(subdir) ⇒ String
Returns the path to the sub-directory within the ~/.cache/
directory.
46 47 48 |
# File 'lib/ronin/support/home.rb', line 46 def self.cache_dir(subdir) File.join(CACHE_DIR,subdir) end |
.config_dir(subdir) ⇒ String
Returns the path to the sub-directory within the ~/.config/
directory.
64 65 66 |
# File 'lib/ronin/support/home.rb', line 64 def self.config_dir(subdir) File.join(CONFIG_DIR,subdir) end |
.local_share_dir(subdir) ⇒ String
Returns the path to the sub-directory within the ~/.local/share/
directory.
83 84 85 |
# File 'lib/ronin/support/home.rb', line 83 def self.local_share_dir(subdir) File.join(LOCAL_SHARE_DIR,subdir) end |