fn parse_component(&self, id: &str, yaml: &str) -> Result<Component> {
        info!("parsing component '{}'", id);
        let mut config = Config::from_yaml(yaml)?;
        if config.contains("package.outline") {
            let path = config.get_string("package.outline")?;
            let parts: Vec<_> = path.split('@').collect();
            let variation = if parts.len() > 1 { parts[1] } else { "" };

            if let Some(outline) = self.outlines.get(parts[0]) {
                let object = outline.as_object().unwrap();
                for (k, v) in object {
                    let re = Regex::new(&format!("^{}$", &k)).unwrap();
                    if variation.is_empty() || re.is_match(&variation.to_lowercase()) {
                        config.merge_with_value("package", &v);
                    }
                }
            }
        }
        let component = Component::from_config(&config, &self)?;
        debug!("component short digest: {}", component.digest_short());
        Ok(component)
    }
// Parse component's YAML description
Parse component's YAML description
Parse component ' s YAML description
fn parse_component(&self, id: &str, yaml: &str) -> Result<Component> {
        info!("parsing component '{}'", id);
        let mut config = Config::from_yaml(yaml)?;
        if config.contains("package.outline") {
            let path = config.get_string("package.outline")?;
            let parts: Vec<_> = path.split('@').collect();
            let variation = if parts.len() > 1 { parts[1] } else { "" };
            if let Some(outline) = self.outlines.get(parts[0]) {
                let object = outline.as_object().unwrap();
                for (k, v) in object {
                    let re = Regex::new(&format!("^{}$", &k)).unwrap();
                    if variation.is_empty() || re.is_match(&variation.to_lowercase()) {
                        config.merge_with_value("package", &v);
                    }
                }
            }
        }
        let component = Component::from_config(&config, &self)?;
        debug!("component short digest: {}", component.digest_short());
        Ok(component)
    }
fn parse_component ( & self , id : & str , yaml : & str ) -> Result < Component > { info ! ( " " id ) ; let mut config = Config :: from_yaml ( yaml ) ? ; if config . contains ( " " ) { let path = config . get_string ( " " ) ? ; let parts : Vec < _ > = path . split ( '@' ) . collect ( ) ; let variation = if parts . len ( ) > 1 { parts [ 1 ] } else { " " } ; if let Some ( outline ) = self . outlines . get ( parts [ 0 ] ) { let object = outline . as_object ( ) . unwrap ( ) ; for ( k , v ) in object { let re = Regex :: new ( & format ! ( " " k ) ) . unwrap ( ) ; if variation . is_empty ( ) || re . is_match ( & variation . to_lowercase ( ) ) { config . merge_with_value ( " " , & v ) ; } } } } let component = Component :: from_config ( & config , & self ) ? ; debug ! ( " " component digest_short ( ) ) ; Ok ( component ) }
Parse component's YAML description
Parse component ' s YAML description
&self
id
&str
yaml
&str
&self
id
&str
yaml
&str