Module: Depot::Paths

Defined in:
lib/depot/paths.rb

Class Method Summary collapse

Class Method Details

.apps_dirObject



33
34
35
# File 'lib/depot/paths.rb', line 33

def apps_dir
  File.join(data_dir, "apps")
end

.config_dirObject



25
26
27
# File 'lib/depot/paths.rb', line 25

def config_dir
  File.join(config_home, "depot")
end

.config_homeObject



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_dirObject



21
22
23
# File 'lib/depot/paths.rb', line 21

def data_dir
  File.join(data_home, "depot")
end

.data_homeObject



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_dirObject



41
42
43
# File 'lib/depot/paths.rb', line 41

def desktop_entries_dir
  File.join(data_home, "applications")
end

.ensure_base_dirsObject



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_rootObject



45
46
47
# File 'lib/depot/paths.rb', line 45

def icon_root
  File.join(data_home, "icons", "hicolor")
end

.manifests_dirObject



37
38
39
# File 'lib/depot/paths.rb', line 37

def manifests_dir
  File.join(data_dir, "manifests")
end

.settings_pathObject



49
50
51
# File 'lib/depot/paths.rb', line 49

def settings_path
  File.join(config_dir, "settings.json")
end

.state_dirObject



29
30
31
# File 'lib/depot/paths.rb', line 29

def state_dir
  File.join(state_home, "depot")
end

.state_homeObject



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