Skip to content

Commit

Permalink
No longer strips "Pipeline" suffix from pipeline classes
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Oct 3, 2019
1 parent c80825b commit 98d2248
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Adds back a `ExecuteModules` module that works like the old `Branch` module used to by dropping any output documents from the child modules.
- Tweaks to the placeholder factory in `CreateTree`.
- Fix for the JavaScript engine getting reset on execution.
- No longer strips "Pipeline" from the end of pipeline classes for the pipeline name since `nameof` is often used to refer to pipelines.

# 1.0.0-alpha.5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ namespace Statiq.Common
/// </summary>
public partial interface IPipelineCollection
{
public void Add(IPipeline pipeline) => Add(pipeline?.GetType().Name.RemoveEnd("Pipeline", StringComparison.OrdinalIgnoreCase), pipeline);
public void Add(IPipeline pipeline) => Add(pipeline?.GetType().Name, pipeline);

public IPipeline Add(Type pipelineType) =>
Add(
pipelineType ?? throw new ArgumentNullException(nameof(pipelineType)),
pipelineType.Name.RemoveEnd("Pipeline", StringComparison.OrdinalIgnoreCase));
Add(pipelineType ?? throw new ArgumentNullException(nameof(pipelineType)), pipelineType.Name);

public IPipeline Add(Type pipelineType, string name)
{
Expand All @@ -28,7 +26,7 @@ public IPipeline Add(Type pipelineType, string name)

public IPipeline Add<TPipeline>()
where TPipeline : IPipeline =>
Add<TPipeline>(typeof(TPipeline).Name.RemoveEnd("Pipeline", StringComparison.OrdinalIgnoreCase));
Add<TPipeline>(typeof(TPipeline).Name);

public IPipeline Add<TPipeline>(string name)
where TPipeline : IPipeline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task ExecutesCorrectPipelines()
IPipelineOutputs outputs = await engine.ExecuteAsync(cts);

// Then
outputs["TestExecution"].Cast<TestDocument>().Select(x => x.Content).Single().ShouldBe("Foo");
outputs["TestExecutionPipeline"].Cast<TestDocument>().Select(x => x.Content).Single().ShouldBe("Foo");
}
}

Expand Down

0 comments on commit 98d2248

Please sign in to comment.