this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

wip

+13 -19
+10 -12
toru/lib/toru/cache.ml
··· 16 16 base_path : Eio.Fs.dir_ty Eio.Path.t; 17 17 version : string option; 18 18 sw : Eio.Switch.t; 19 - env : Eio_unix.Stdenv.base; 20 19 } 21 20 22 - let rec create ~sw ~env ?version path_str = 23 - let base_path = Eio.Path.(env#fs / path_str) in 24 - { base_path; version; sw; env } 25 - 26 - and default ~sw ~env ?app_name () = 21 + let rec create ~sw ~fs ?app_name ?version path_str = 27 22 let app_name = Option.value app_name ~default:"toru" in 28 - let path_str = default_cache_path ~app_name () in 29 - create ~sw ~env path_str 23 + let xdg_dirs = Xdg.create ~env:Sys.getenv_opt () in 24 + let cache_dir = Xdg.cache_dir xdg_dirs in 25 + Filename.concat cache_dir app_name 26 + let base_path = Eio.Path.(fs / path_str) in 27 + { base_path; version; sw } 28 + 29 + and default ~sw ?app_name () = 30 + create ~sw path_str 30 31 31 32 and default_cache_path ?app_name () = 32 33 let app_name = Option.value app_name ~default:"toru" in 33 34 (* Use the official xdg package for XDG Base Directory Specification *) 34 - let xdg_dirs = Xdg.create ~env:Sys.getenv_opt () in 35 - let cache_dir = Xdg.cache_dir xdg_dirs in 36 - Filename.concat cache_dir app_name 37 35 38 36 let base_path t = t.base_path 39 37 let version t = t.version ··· 293 291 let version_str = Option.fold t.version ~none:"no version" 294 292 ~some:(fun v -> "version " ^ v) in 295 293 Format.fprintf fmt "Cache at %s (%s)" 296 - (Eio.Path.native_exn t.base_path) version_str 294 + (Eio.Path.native_exn t.base_path) version_str
+2 -6
toru/lib/toru/cache.mli
··· 6 6 (** {1 Construction} *) 7 7 8 8 (** Create cache with explicit path *) 9 - val create : sw:Eio.Switch.t -> env:Eio_unix.Stdenv.base -> 9 + val create : sw:Eio.Switch.t -> fs:Eio.Fs.dir_ty Eio.Path.t -> 10 10 ?version:string -> string -> t 11 - 12 - (** Create cache using default OS-specific location *) 13 - val default : sw:Eio.Switch.t -> env:Eio_unix.Stdenv.base -> 14 - ?app_name:string -> unit -> t 15 11 16 12 (** {1 Field accessors} *) 17 13 ··· 80 76 (** {1 Pretty printing} *) 81 77 82 78 (** Pretty printer for cache *) 83 - val pp : Format.formatter -> t -> unit 79 + val pp : Format.formatter -> t -> unit
+1 -1
toru/lib/toru/dune
··· 13 13 xdg)) 14 14 15 15 (documentation 16 - (package toru)) 16 + (package toru))