auberge 0.8.1

CLI tool for managing self-hosted infrastructure with Ansible
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::path::PathBuf;

#[derive(Debug, Clone)]
pub struct Playbook {
    pub path: PathBuf,
    pub name: String,
}

impl Playbook {
    pub fn from_path(path: PathBuf) -> Self {
        let name = path
            .file_stem()
            .and_then(|s| s.to_str())
            .unwrap_or("unknown")
            .to_string();
        Self { path, name }
    }
}