DependencyEnsurer — composes IShell + IDistroDetector + IPackageInstaller
to deliver the user-level ensure! verb.
The record itself is pure-data + dispatch; every side effect goes
through one of the three injected ports. Tests exercise the policy
matrix (:auto / :ask / :throw) by feeding fakes.
DependencyEnsurer — composes IShell + IDistroDetector + IPackageInstaller to deliver the user-level `ensure!` verb. The record itself is pure-data + dispatch; every side effect goes through one of the three injected ports. Tests exercise the policy matrix (`:auto` / `:ask` / `:throw`) by feeding fakes.
(make-ensurer {:keys [shell distro-detector package-installer prompt-fn]})Construct a DependencyEnsurer.
Required:
:shell — IShell impl (used for which)
:distro-detector — IDistroDetector impl
:package-installer — IPackageInstaller impl
Optional: :prompt-fn — (fn [spec]) → Result<bool>. Called for specs with :on-missing :ask. ok-truthy = install, ok-falsy = decline, err = abort that spec into :failed.
Construct a DependencyEnsurer.
Required:
:shell — IShell impl (used for `which`)
:distro-detector — IDistroDetector impl
:package-installer — IPackageInstaller impl
Optional:
:prompt-fn — (fn [spec]) → Result<bool>. Called for specs with
:on-missing :ask. ok-truthy = install, ok-falsy =
decline, err = abort that spec into :failed.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |