Class: Depot::Doctor
- Inherits:
-
Object
- Object
- Depot::Doctor
- Defined in:
- lib/depot/doctor.rb
Constant Summary collapse
- TOOLS =
%w[flatpak bwrap bsdtar gtk-update-icon-cache update-desktop-database].freeze
Instance Method Summary collapse
- #healthy? ⇒ Boolean
-
#initialize(store: ManifestStore.new) ⇒ Doctor
constructor
A new instance of Doctor.
- #report ⇒ Object
Constructor Details
#initialize(store: ManifestStore.new) ⇒ Doctor
Returns a new instance of Doctor.
11 12 13 |
# File 'lib/depot/doctor.rb', line 11 def initialize(store: ManifestStore.new) @store = store end |
Instance Method Details
#healthy? ⇒ Boolean
28 29 30 |
# File 'lib/depot/doctor.rb', line 28 def healthy? report.fetch("manifests").all? { |manifest| manifest.fetch("ok") } end |
#report ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/depot/doctor.rb', line 15 def report { "tools" => TOOLS.to_h { |tool| [tool, command_available?(tool)] }, "paths" => { "data_dir" => Dir.exist?(Paths.data_dir), "apps_dir" => Dir.exist?(Paths.apps_dir), "manifests_dir" => Dir.exist?(Paths.manifests_dir), "desktop_entries_dir" => Dir.exist?(Paths.desktop_entries_dir) }, "manifests" => manifest_checks } end |