Module: Depot::Paths
- Defined in:
- lib/depot/paths.rb
Class Method Summary collapse
- .apps_dir ⇒ Object
- .config_dir ⇒ Object
- .config_home ⇒ Object
- .data_dir ⇒ Object
- .data_home ⇒ Object
- .desktop_entries_dir ⇒ Object
- .ensure_base_dirs ⇒ Object
- .icon_root ⇒ Object
- .manifests_dir ⇒ Object
- .settings_path ⇒ Object
- .state_dir ⇒ Object
- .state_home ⇒ Object
Class Method Details
.apps_dir ⇒ Object
33 34 35 |
# File 'lib/depot/paths.rb', line 33 def apps_dir File.join(data_dir, "apps") end |
.config_dir ⇒ Object
25 26 27 |
# File 'lib/depot/paths.rb', line 25 def config_dir File.join(config_home, "depot") end |
.config_home ⇒ Object
13 14 15 |
# File 'lib/depot/paths.rb', line 13 def config_home ENV.fetch("XDG_CONFIG_HOME", File.join(Dir.home, ".config")) end |
.data_dir ⇒ Object
21 22 23 |
# File 'lib/depot/paths.rb', line 21 def data_dir File.join(data_home, "depot") end |
.data_home ⇒ Object
9 10 11 |
# File 'lib/depot/paths.rb', line 9 def data_home ENV.fetch("XDG_DATA_HOME", File.join(Dir.home, ".local", "share")) end |
.desktop_entries_dir ⇒ Object
41 42 43 |
# File 'lib/depot/paths.rb', line 41 def desktop_entries_dir File.join(data_home, "applications") end |
.ensure_base_dirs ⇒ Object
53 54 55 |
# File 'lib/depot/paths.rb', line 53 def ensure_base_dirs FileUtils.mkdir_p([data_dir, config_dir, state_dir, apps_dir, manifests_dir, desktop_entries_dir]) end |
.icon_root ⇒ Object
45 46 47 |
# File 'lib/depot/paths.rb', line 45 def icon_root File.join(data_home, "icons", "hicolor") end |
.manifests_dir ⇒ Object
37 38 39 |
# File 'lib/depot/paths.rb', line 37 def manifests_dir File.join(data_dir, "manifests") end |
.settings_path ⇒ Object
49 50 51 |
# File 'lib/depot/paths.rb', line 49 def settings_path File.join(config_dir, "settings.json") end |
.state_dir ⇒ Object
29 30 31 |
# File 'lib/depot/paths.rb', line 29 def state_dir File.join(state_home, "depot") end |
.state_home ⇒ Object
17 18 19 |
# File 'lib/depot/paths.rb', line 17 def state_home ENV.fetch("XDG_STATE_HOME", File.join(Dir.home, ".local", "state")) end |