-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
450323d
commit 32292b4
Showing
27 changed files
with
1,084 additions
and
1,101 deletions.
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
.github/workflows/club_scraper.yml → .github/workflows/mock_data.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use chrono::Local; | ||
use std::{error::Error, fs::File, io::Write}; | ||
|
||
use crate::domain::{club::Club, Category, Tag}; | ||
|
||
fn autogen_commenter<F>(file: &mut File, func: F) -> Result<(), Box<dyn Error>> | ||
where | ||
F: FnOnce(&mut File) -> Result<(), Box<dyn Error>>, | ||
{ | ||
writeln!(file, "-- AUTOGENERATED MOCK DATA, DO NOT MODIFY")?; | ||
writeln!( | ||
file, | ||
"-- GENERATED AT {}", | ||
Local::now().format("%Y-%m-%d %H:%M:%S") | ||
)?; | ||
func(file)?; | ||
writeln!(file, "-- END AUTOGENERATED MOCK DATA")?; | ||
Ok(()) | ||
} | ||
|
||
pub fn dump_all( | ||
categories: &[Category], | ||
tags: &[&Tag], | ||
clubs: Vec<Club>, | ||
club_parent: uuid::Uuid, | ||
file: &mut File, | ||
) -> Result<(), Box<dyn Error>> { | ||
autogen_commenter(file, |file| { | ||
writeln!(file, "BEGIN;")?; | ||
crate::dumper::category::dump(categories, file)?; | ||
crate::dumper::tag::dump(tags, file)?; | ||
crate::dumper::club::dump(clubs, file, club_parent)?; | ||
writeln!(file, "COMMIT;")?; | ||
Ok(()) | ||
})?; | ||
|
||
Ok(()) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.