pub struct ChangelogExtractor {
pub changelog_file: String,
}Expand description
Extracts the changelog text for a specific version to be used in the version description as release note
§Fields
changelog_file- The path to the changelog file
Fields§
§changelog_file: StringPath to the changelog file used to derive release notes.
Implementations§
Source§impl ChangelogExtractor
Implementation of the ChangelogExtractor
impl ChangelogExtractor
Implementation of the ChangelogExtractor
Sourcepub fn new(changelog_file: String) -> Self
pub fn new(changelog_file: String) -> Self
Creates a new ChangelogExtractor
§Arguments
changelog_file- The path to the changelog file
§Returns
- A new ChangelogExtractor
§Examples
use jirust_cli::utils::changelog_extractor::ChangelogExtractor;
let changelog_extractor = ChangelogExtractor::new("CHANGELOG.md".to_string());
assert_eq!(changelog_extractor.changelog_file, "CHANGELOG.md");Sourcepub fn extract_version_changelog(&self) -> Result<String, Box<dyn Error>>
pub fn extract_version_changelog(&self) -> Result<String, Box<dyn Error>>
Extracts the changelog text for a specific version to be used in the version description as release note The version changelog text is extracted from the changelog file using the notes between the first and second version headers in markdown “Keep a Changelog” changelog formatted file
§Returns
- The version changelog text
§Errors
- If the changelog file cannot be read or the version changelog text cannot be extracted
§Examples
use jirust_cli::utils::changelog_extractor::ChangelogExtractor;
let changelog_extractor = ChangelogExtractor::new("CHANGELOG.md".to_string());
let version_changelog_text = changelog_extractor.extract_version_changelog();Sourcepub fn extract_issues_from_changelog(
&self,
version_string: &String,
project_key: &String,
) -> Result<Vec<String>, Box<dyn Error>>
pub fn extract_issues_from_changelog( &self, version_string: &String, project_key: &String, ) -> Result<Vec<String>, Box<dyn Error>>
Extracts the issues from the version changelog text The issues are extracted from the version changelog text using the project key and issue number
§Arguments
version_string- The version changelog textproject_key- The project key
§Returns
Result<Vec<String>, Box<dyn Error>>- The issues extracted from the version changelog text
§Examples
use jirust_cli::utils::changelog_extractor::ChangelogExtractor;
let changelog_extractor = ChangelogExtractor::new("CHANGELOG.md".to_string());
let version_changelog_text = changelog_extractor.extract_version_changelog();
let project_key = "JIR".to_string();
let issues = changelog_extractor.extract_issues_from_changelog(&version_changelog_text.unwrap(), &project_key);Auto Trait Implementations§
impl Freeze for ChangelogExtractor
impl RefUnwindSafe for ChangelogExtractor
impl Send for ChangelogExtractor
impl Sync for ChangelogExtractor
impl Unpin for ChangelogExtractor
impl UnwindSafe for ChangelogExtractor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more