pub mod error;
pub mod model;
pub mod version;
pub use error::ContractError;
pub use model::{
BuildTool, Contract, Language, Pipeline, Platform, Registry, Scope, Source, SourceControl,
SourceType, Stage, StageBuild, StageRelease, StageTest, VersionSource,
detect_language_by_files,
};
pub use version::{normalize_version, read_all_config_versions, validate_version};
use std::path::Path;
pub fn load(repo_path: &Path) -> Result<Contract, ContractError> {
let path = repo_path.join(".quanttide/devops/contract.yaml");
let content = std::fs::read_to_string(&path)?;
load_from_str(&content)
}
pub fn load_from_str(s: &str) -> Result<Contract, ContractError> {
serde_yaml::from_str::<Contract>(s).map_err(|e| ContractError::Parse(e.to_string()))
}