From 74a9f74455e46182eb8158b8ecddb5b9898e6032 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 04:06:05 +0000 Subject: [PATCH 1/3] chore(deps): Bump ructe from 0.15.0 to 0.16.1 Bumps [ructe](https://github.com/kaj/ructe) from 0.15.0 to 0.16.1. - [Release notes](https://github.com/kaj/ructe/releases) - [Changelog](https://github.com/kaj/ructe/blob/master/CHANGELOG.md) - [Commits](https://github.com/kaj/ructe/compare/v0.15.0...v0.16.1) --- updated-dependencies: - dependency-name: ructe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33334e2..fbca26f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1680,11 +1680,11 @@ dependencies = [ [[package]] name = "ructe" -version = "0.15.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85517cd381cf0c34694881d8aaf173107c6af7670e66cec18d7a1a8bfce3b758" +checksum = "79c86c1631418815c5947a34be5872806586c65398754ec91cc2df35a8e26ba8" dependencies = [ - "base64 0.13.0", + "base64 0.21.0", "bytecount", "itertools", "md5", diff --git a/Cargo.toml b/Cargo.toml index 363a373..518ed1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,11 +37,11 @@ tracing-log = "0.1.3" tracing-subscriber = { version = "0.3.16", features = ["registry", "env-filter"] } [build-dependencies] -ructe = { version = "0.15.0", features = ["mime03"] } +ructe = { version = "0.16.1", features = ["mime03"] } vergen = { version = "7.5.0", default-features = false, features = ["git"] } [dev-dependencies] awc = "3.0.1" -ructe = "0.15.0" +ructe = "0.16.1" tempfile = "3.3.0" tokio = "1.24.2" From 4ddaa84e5f2c181d6ec7ac7e0d826fa9fcc3f242 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Mon, 30 Jan 2023 09:22:45 +0100 Subject: [PATCH 2/3] Use new aliases for template functions `page.rs.html` used to result in a function `templates::page`. Since ructe 0.7.2, `templates::page_html` was used and now the old alias has been removed. --- src/error.rs | 4 ++-- src/lib.rs | 8 ++++---- templates/generate.rs.html | 4 ++-- templates/index.rs.html | 4 ++-- templates/overview.rs.html | 4 ++-- templates/p404.rs.html | 4 ++-- templates/p404_no_master.rs.html | 4 ++-- templates/p500.rs.html | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/error.rs b/src/error.rs index faa13d8..0f71446 100644 --- a/src/error.rs +++ b/src/error.rs @@ -43,11 +43,11 @@ impl ResponseError for Error { let mut buf = Vec::new(); match self { Error::BranchNotFound => { - templates::p404_no_master(&mut buf, VERSION_INFO, 0).unwrap(); + templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap(); HttpResponse::NotFound().content_type("text/html").body(buf) } _ => { - templates::p500(&mut buf, VERSION_INFO, 0).unwrap(); + templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap(); HttpResponse::InternalServerError() .content_type("text/html") .body(buf) diff --git a/src/lib.rs b/src/lib.rs index f917c51..d24abf8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -408,7 +408,7 @@ async fn overview( url: &url, branch, }; - templates::overview( + templates::overview_html( &mut buf, VERSION_INFO, rc_clone.load(Ordering::Relaxed), @@ -433,7 +433,7 @@ async fn index( repo_count: web::Data, ) -> Result { let mut buf = Vec::new(); - templates::index( + templates::index_html( &mut buf, VERSION_INFO, repo_count.load(Ordering::Relaxed), @@ -459,7 +459,7 @@ async fn generate( .filter(|s| !s.is_empty()) .unwrap_or("master"), }; - templates::generate( + templates::generate_html( &mut buf, VERSION_INFO, repo_count.load(Ordering::Relaxed), @@ -472,7 +472,7 @@ async fn generate( fn p404(repo_count: web::Data) -> Result { let mut buf = Vec::new(); - templates::p404(&mut buf, VERSION_INFO, repo_count.load(Ordering::Relaxed))?; + templates::p404_html(&mut buf, VERSION_INFO, repo_count.load(Ordering::Relaxed))?; Ok(HttpResponse::NotFound().content_type("text/html").body(buf)) } diff --git a/templates/generate.rs.html b/templates/generate.rs.html index 2ce62cc..15c9b85 100644 --- a/templates/generate.rs.html +++ b/templates/generate.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::{statics::VersionInfo, template::RepoGeneratorInfo}; @(version_info: VersionInfo, repo_count: usize, base_url: &str, repo_info: &RepoGeneratorInfo) -@:base("Hits-of-Code Badges", "Badge Generator", { +@:base_html("Hits-of-Code Badges", "Badge Generator", {

Here is the markdown for the badge for @repo_info.user/@repo_info.repo diff --git a/templates/index.rs.html b/templates/index.rs.html index 75934d4..d032390 100644 --- a/templates/index.rs.html +++ b/templates/index.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @(version_info: VersionInfo, repo_count: usize, base_url: &str) -@:base("Hits-of-Code Badges", "Hits-of-Code Badges", { +@:base_html("Hits-of-Code Badges", "Hits-of-Code Badges", {

This API offers badges for the Hits-of-Code metric for your repositories. This metric was proposed by diff --git a/templates/overview.rs.html b/templates/overview.rs.html index ef209a1..578da5d 100644 --- a/templates/overview.rs.html +++ b/templates/overview.rs.html @@ -1,10 +1,10 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @use crate::template::RepoInfo; @(version_info: VersionInfo, repo_count: usize, repo_info: RepoInfo, label: String) -@:base("Hits-of-Code Badges", "Overview", { +@:base_html("Hits-of-Code Badges", "Overview", {

The project @repo_info.url has diff --git a/templates/p404.rs.html b/templates/p404.rs.html index a073b33..c1dfa15 100644 --- a/templates/p404.rs.html +++ b/templates/p404.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @(version_info: VersionInfo, repo_count: usize) -@:base("Page not Found - Hits-of-Code Badges", "404 - Page not Found", { +@:base_html("Page not Found - Hits-of-Code Badges", "404 - Page not Found", {

Sorry. I couldn't find the page you are looking for. Please go back to the homepage.

diff --git a/templates/p404_no_master.rs.html b/templates/p404_no_master.rs.html index 309f5c5..6b32df8 100644 --- a/templates/p404_no_master.rs.html +++ b/templates/p404_no_master.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @(version_info: VersionInfo, repo_count: usize) -@:base("Branch not Found - Hits-of-Code Badges", "404 - Branch not Found", { +@:base_html("Branch not Found - Hits-of-Code Badges", "404 - Branch not Found", {

Sorry. I couldn't find the requested branch of your repositroy. Currently this service assumes the extistence of a branch named master. If you'd like to request a badge for another branch, you can do so by diff --git a/templates/p500.rs.html b/templates/p500.rs.html index e1725a7..264c08e 100644 --- a/templates/p500.rs.html +++ b/templates/p500.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @(version_info: VersionInfo, repo_count: usize) -@:base("Internal Server Error - Hits-of-Code Badges", "500 - Internal Server Error", { +@:base_html("Internal Server Error - Hits-of-Code Badges", "500 - Internal Server Error", {

Oops. Looks like a made a mistake. Please go back to the homepage and try again.

From a73f07e4919b7f91f3116f06ff74725288b7897e Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Mon, 30 Jan 2023 09:35:27 +0100 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 671f9a2..83f0084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Updated [`tokio`](https://github.com/tokio-rs/tokio) from 1.24.1 to 1.24.2 ([#547]) * Updated [`reqwest`](https://github.com/seanmonstar/reqwest) from 0.11.13 to 0.11.14 ([#549]) +* Updated [`ructe`](https://github.com/kaj/ructe) from 0.15.0 to 0.16.1 ([#559]) [#547]: https://github.com/vbrandl/hoc/pull/547 +[#559]: https://github.com/vbrandl/hoc/pull/559 ## [0.30.0] 2023-01-16