feat: made PipelineBase.AddDependency be a params

This commit is contained in:
D. Moonfire 2023-01-15 12:20:41 -06:00
parent 084aa7e812
commit a8c6d0e582
6 changed files with 33 additions and 17 deletions

View file

@ -25,7 +25,10 @@ public class ForEachHandlebarsBlock<TModel> : HandlebarsBlockBase
/// </summary> /// </summary>
public Action<EncodedTextWriter, BlockHelperOptions, Context, Arguments>? public Action<EncodedTextWriter, BlockHelperOptions, Context, Arguments>?
NothingFound NothingFound
{ get; set; } {
get;
set;
}
/// <inheritdoc /> /// <inheritdoc />
protected override string HelperName { get; } protected override string HelperName { get; }

View file

@ -4,9 +4,9 @@ This assembly contains the primary system for reading and writing from the disk,
along with various processes to manipulate paths. It contains three primary along with various processes to manipulate paths. It contains three primary
components: components:
- File System I/O - File System I/O
- Path Normalization - Path Normalization
- Disk-Based Content - Disk-Based Content
## File System I/O ## File System I/O

View file

@ -20,10 +20,10 @@ public class IdentifyMarkdownFromPath : IdentifyMarkdown
{ {
return (path.GetExtensionWithDot() ?? string.Empty).ToLowerInvariant() return (path.GetExtensionWithDot() ?? string.Empty).ToLowerInvariant()
switch switch
{ {
".md" => true, ".md" => true,
".markdown" => true, ".markdown" => true,
_ => false, _ => false,
}; };
} }
} }

View file

@ -32,7 +32,10 @@ public class ParseYamlHeader<TModel> : OperationBase
public Func<Entity, string, Exception, ParseYamlHeaderErrorHandling>? public Func<Entity, string, Exception, ParseYamlHeaderErrorHandling>?
EntityError EntityError
{ get; set; } {
get;
set;
}
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the header should be removed /// Gets or sets a value indicating whether the header should be removed

View file

@ -16,9 +16,19 @@ public abstract class PipelineBase : IPipeline
this.dependencies = new List<IPipeline>(); this.dependencies = new List<IPipeline>();
} }
public PipelineBase AddDependency(IPipeline pipeline) /// <summary>
/// Adds one or more pipeline dependencies into the current one. All of
/// the dependencies are guaranteed to run before this pipeline's RunAsync
/// is called.
/// </summary>
/// <param name="pipelines">The pipelines to add as a dependency.</param>
/// <returns>The same object for chaining operations.</returns>
public PipelineBase AddDependency(params IPipeline[] pipelines)
{ {
this.dependencies.Add(pipeline); foreach (IPipeline pipeline in pipelines)
{
this.dependencies.Add(pipeline);
}
return this; return this;
} }

View file

@ -2,8 +2,8 @@
## Immediate ## Immediate
- Switch the various operations to be async - Switch the various operations to be async
- ReadFiles - ReadFiles
- WriteFiles - WriteFiles
- Implement mime type determination - Implement mime type determination
- Implement a convert to text content based on mime type - Implement a convert to text content based on mime type