1use std::path::{Path, PathBuf};
6
7pub fn default_ito_root(workspace_root: &Path) -> PathBuf {
13 workspace_root.join(".ito")
14}
15
16pub fn changes_dir(ito_path: &Path) -> PathBuf {
18 ito_path.join("changes")
19}
20
21pub fn change_dir(ito_path: &Path, change_id: &str) -> PathBuf {
23 changes_dir(ito_path).join(change_id)
24}
25
26pub fn change_meta_path(ito_path: &Path, change_id: &str) -> PathBuf {
28 change_dir(ito_path, change_id).join(".ito.yaml")
29}
30
31pub fn change_specs_dir(ito_path: &Path, change_id: &str) -> PathBuf {
33 change_dir(ito_path, change_id).join("specs")
34}
35
36pub fn changes_archive_dir(ito_path: &Path) -> PathBuf {
38 changes_dir(ito_path).join("archive")
39}
40
41pub fn archive_changes_dir(ito_path: &Path) -> PathBuf {
43 ito_path.join("archive").join("changes")
44}
45
46pub fn modules_dir(ito_path: &Path) -> PathBuf {
48 ito_path.join("modules")
49}
50
51pub fn specs_dir(ito_path: &Path) -> PathBuf {
53 ito_path.join("specs")
54}
55
56pub fn spec_markdown_path(ito_path: &Path, spec_id: &str) -> PathBuf {
58 specs_dir(ito_path).join(spec_id).join("spec.md")
59}
60
61#[cfg(test)]
62#[path = "paths_tests.rs"]
63mod paths_tests;