Module: CommandKit::Env::Home
- Extended by:
- ModuleMethods
- Includes:
- CommandKit::Env
- Included in:
- Completion::Install, XDG
- Defined in:
- lib/command_kit/env/home.rb
Overview
Provides access to the HOME
environment variable.
Environment Variables
HOME
- The absolute path to the user's home directory.
Defined Under Namespace
Modules: ClassMethods, ModuleMethods
Instance Attribute Summary collapse
-
#home_dir ⇒ String
readonly
The home directory.
Attributes included from CommandKit::Env
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Object
Initializes #home_dir to either
env['HOME']
or self.class.home_dir.
Methods included from ModuleMethods
Instance Attribute Details
#home_dir ⇒ String (readonly)
The home directory.
62 63 64 |
# File 'lib/command_kit/env/home.rb', line 62 def home_dir @home_dir end |
Instance Method Details
#initialize(**kwargs) ⇒ Object
Initializes #home_dir to either env['HOME']
or
self.class.home_dir.
73 74 75 76 77 |
# File 'lib/command_kit/env/home.rb', line 73 def initialize(**kwargs) super(**kwargs) @home_dir = env.fetch('HOME') { self.class.home_dir } end |