Skip to content

Commit

Permalink
Remove output module, rename output feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Malax committed Jan 29, 2024
1 parent b7fe2e6 commit 149eea5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions libherokubuildpack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ all-features = true
workspace = true

[features]
default = ["command", "download", "digest", "error", "log", "tar", "toml", "fs", "write", "output"]
default = ["command", "download", "digest", "error", "log", "tar", "toml", "fs", "write", "buildpack_output"]
download = ["dep:ureq", "dep:thiserror"]
digest = ["dep:sha2"]
error = ["log", "dep:libcnb"]
Expand All @@ -27,7 +27,7 @@ tar = ["dep:tar", "dep:flate2"]
toml = ["dep:toml"]
fs = ["dep:pathdiff"]
command = ["write", "dep:crossbeam-utils"]
output = ["dep:const_format"]
buildpack_output = ["dep:const_format"]
write = []

[dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
//! The main use case is writing output in a layer:
//!
//! ```no_run
//! use libherokubuildpack::output::inline_output;
//! use libherokubuildpack::buildpack_output::inline_output;
//!
//! inline_output::step("Clearing the cache")
//! ```
use crate::output::buildpack_output::{state, BuildpackOutput, Stream};
use crate::buildpack_output::{state, BuildpackOutput, Stream};
use std::io::Stdout;
use std::time::Instant;

/// Output a message as a single step, ideally a short message.
///
/// ```
/// use libherokubuildpack::output::inline_output;
/// use libherokubuildpack::buildpack_output::inline_output;
///
/// inline_output::step("Clearing cache (ruby version changed)");
/// ```
Expand All @@ -40,8 +40,8 @@ pub fn step(s: impl AsRef<str>) {
///
/// ```no_run
/// use fun_run::CommandWithName;
/// use libherokubuildpack::output::inline_output;
/// use libherokubuildpack::output::style;
/// use libherokubuildpack::buildpack_output::inline_output;
/// use libherokubuildpack::buildpack_output::style;
///
/// let mut cmd = std::process::Command::new("bundle");
/// cmd.arg("install");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Use the [`BuildpackOutput`] to output structured text as a buildpack is executing.
//!
//! ```
//! use libherokubuildpack::output::buildpack_output::BuildpackOutput;
//! use libherokubuildpack::buildpack_output::BuildpackOutput;
//!
//! let mut output = BuildpackOutput::new(std::io::stdout())
//! .start("Heroku Ruby Buildpack");
Expand All @@ -15,12 +15,15 @@
//! output.finish();
//! ```
//!
use crate::output::style;
use std::fmt::Debug;
use std::io::Write;
use std::sync::{Arc, Mutex};
use std::time::Instant;

pub mod inline_output;
pub mod style;
mod util;

/// See the module docs for example usage.
#[allow(clippy::module_name_repetitions)]
#[derive(Debug)]
Expand Down Expand Up @@ -346,9 +349,9 @@ fn writeln_now<D: Write>(destination: &mut D, msg: impl AsRef<str>) {
#[cfg(test)]
mod test {
use super::*;
use crate::buildpack_output::style::strip_control_codes;
use crate::buildpack_output::util::test_helpers::trim_end_lines;
use crate::command::CommandExt;
use crate::output::style::strip_control_codes;
use crate::output::util::test_helpers::trim_end_lines;
use indoc::formatdoc;
use libcnb_test::assert_contains;
use pretty_assertions::assert_eq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::output::util::LinesWithEndings;
use crate::buildpack_output::util::LinesWithEndings;
use const_format::formatcp;
use std::fmt::Write;

Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions libherokubuildpack/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![doc = include_str!("../README.md")]

#[cfg(feature = "buildpack_output")]
pub mod buildpack_output;
#[cfg(feature = "command")]
pub mod command;
#[cfg(feature = "digest")]
Expand All @@ -12,13 +14,12 @@ pub mod error;
pub mod fs;
#[cfg(feature = "log")]
pub mod log;
#[cfg(feature = "output")]
pub mod output;
#[cfg(feature = "tar")]
pub mod tar;
#[cfg(feature = "toml")]
pub mod toml;
#[cfg(feature = "write")]
pub mod write;

#[cfg(test)]
use fun_run as _;
4 changes: 0 additions & 4 deletions libherokubuildpack/src/output/mod.rs

This file was deleted.

0 comments on commit 149eea5

Please sign in to comment.