Module: Ego::Filesystem
- Defined in:
- lib/ego/filesystem.rb
Constant Summary collapse
- HANDLER_GLOB =
'handler/*.rb'- BASENAME =
'ego'- XDG_CACHE_HOME =
ENV['XDG_CACHE_HOME'] || File.('~/.cache')
- XDG_CONFIG_HOME =
ENV['XDG_CONFIG_HOME'] || File.('~/.config')
- XDG_DATA_HOME =
ENV['XDG_DATA_HOME'] || File.('~/.local/share')
Class Method Summary collapse
- .builtin_handlers ⇒ Object
- .cache(path = '') ⇒ Object
- .config(path = '') ⇒ Object
- .data(path = '') ⇒ Object
- .user_handlers ⇒ Object
Class Method Details
.builtin_handlers ⇒ Object
24 25 26 |
# File 'lib/ego/filesystem.rb', line 24 def builtin_handlers Dir[File.(HANDLER_GLOB, __dir__)] end |
.cache(path = '') ⇒ Object
12 13 14 |
# File 'lib/ego/filesystem.rb', line 12 def cache path = '' File.join XDG_CACHE_HOME, BASENAME, path end |
.config(path = '') ⇒ Object
16 17 18 |
# File 'lib/ego/filesystem.rb', line 16 def config path = '' File.join XDG_CONFIG_HOME, BASENAME, path end |
.data(path = '') ⇒ Object
20 21 22 |
# File 'lib/ego/filesystem.rb', line 20 def data path = '' File.join XDG_DATA_HOME, BASENAME, path end |
.user_handlers ⇒ Object
28 29 30 |
# File 'lib/ego/filesystem.rb', line 28 def user_handlers Dir[File.(HANDLER_GLOB, config)] end |