Skip to content

Commit 9157922

Browse files
committed
docs: fix ignored doctests and add StorageConfig re-export
- Convert FileSystem and FilePatternInputProvider doctests to runnable examples - Convert StorageConfig::from_env_with doctest to runnable example - Add StorageConfig to storage module re-exports for cleaner imports - Remaining 74 ignored doctests are intentionally illustrative patterns
1 parent 79e8077 commit 9157922

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/cook/input/file_pattern.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,18 @@ use std::path::{Path, PathBuf};
1616
/// with a base directory for testing. It follows the Stillwater pattern
1717
/// of dependency injection via services.
1818
///
19-
/// # Production Usage
19+
/// # Example
2020
///
21-
/// ```ignore
22-
/// let fs = FileSystem::new(); // Uses current working directory
23-
/// let provider = FilePatternInputProvider::with_filesystem(fs);
2421
/// ```
22+
/// use prodigy::cook::input::FileSystem;
2523
///
26-
/// # Test Usage with MockEnv
24+
/// // Production: uses current working directory
25+
/// let fs = FileSystem::new();
26+
/// assert!(fs.base_dir().is_none());
2727
///
28-
/// ```ignore
29-
/// use stillwater::testing::MockEnv;
30-
///
31-
/// let fs = FileSystem::with_base_dir(temp_path.to_path_buf());
32-
/// let env = MockEnv::new()
33-
/// .with(|| fs)
34-
/// .build();
28+
/// // Testing: uses specific base directory
29+
/// let fs = FileSystem::with_base_dir("/tmp/test".into());
30+
/// assert_eq!(fs.base_dir().unwrap().to_str().unwrap(), "/tmp/test");
3531
/// ```
3632
#[derive(Clone, Debug)]
3733
pub struct FileSystem {
@@ -249,8 +245,10 @@ impl FilePatternInputProvider {
249245
///
250246
/// # Example
251247
///
252-
/// ```ignore
253-
/// let fs = FileSystem::with_base_dir(temp_path.to_path_buf());
248+
/// ```
249+
/// use prodigy::cook::input::{FileSystem, FilePatternInputProvider};
250+
///
251+
/// let fs = FileSystem::with_base_dir("/tmp/test".into());
254252
/// let provider = FilePatternInputProvider::with_filesystem(fs);
255253
/// ```
256254
pub fn with_filesystem(filesystem: FileSystem) -> Self {

src/storage/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ impl StorageConfig {
257257
///
258258
/// # Example
259259
///
260-
/// ```ignore
260+
/// ```
261261
/// use premortem::MockEnv;
262-
/// use prodigy::storage::config::StorageConfig;
262+
/// use prodigy::storage::{StorageConfig, BackendType};
263263
///
264264
/// let env = MockEnv::new()
265265
/// .with_env("PRODIGY_STORAGE_TYPE", "memory");

src/storage/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mod tests;
1818
pub use cleanup::{
1919
parse_duration, CleanupConfig, CleanupStats, StorageCleanupManager, StorageStats,
2020
};
21-
pub use config::{BackendConfig, BackendType};
21+
pub use config::{BackendConfig, BackendType, StorageConfig};
2222
pub use error::{StorageError, StorageResult};
2323
pub use factory::StorageFactory;
2424
pub use global::GlobalStorage;

0 commit comments

Comments
 (0)