Skip to content

Commit

Permalink
Merge pull request #197 from nils-a/release/4.1.0
Browse files Browse the repository at this point in the history
Release/4.1.0
  • Loading branch information
nils-a authored Feb 2, 2023
2 parents 6fab309 + b2c49b1 commit 783cca9
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 20 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
"contributions": [
"doc"
]
},
{
"login": "mcpride",
"name": "Marco Stolze",
"avatar_url": "https://avatars.githubusercontent.com/u/1053528?v=4",
"profile": "https://mcpride.github.io",
"contributions": [
"bug"
]
}
],
"contributorsPerLine": 7,
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ Thanks goes to these wonderful people ([emoji key][emoji-key]):
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://www.nils-andresen.de/"><img src="https://avatars3.githubusercontent.com/u/349188?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nils Andresen</b></sub></a><br /><a href="https://github.com/cake-contrib/cake.asciidoctorj/commits?author=nils-a" title="Code">💻</a> <a href="https://github.com/cake-contrib/cake.asciidoctorj/commits?author=nils-a" title="Documentation">📖</a></td>
<td align="center"><a href="https://twitter.com/hereispascal"><img src="https://avatars1.githubusercontent.com/u/2190718?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pascal Berger</b></sub></a><br /><a href="https://github.com/cake-contrib/cake.asciidoctorj/issues?q=author%3Apascalberger" title="Bug reports">🐛</a> <a href="https://github.com/cake-contrib/cake.asciidoctorj/commits?author=pascalberger" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/DiDoHH"><img src="https://avatars.githubusercontent.com/u/45682415?v=4?s=100" width="100px;" alt=""/><br /><sub><b>DiDoHH</b></sub></a><br /><a href="https://github.com/cake-contrib/cake.asciidoctorj/commits?author=DiDoHH" title="Documentation">📖</a></td>
</tr>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://www.nils-andresen.de/"><img src="https://avatars3.githubusercontent.com/u/349188?v=4?s=100" width="100px;" alt="Nils Andresen"/><br /><sub><b>Nils Andresen</b></sub></a><br /><a href="https://github.com/cake-contrib/cake.asciidoctorj/commits?author=nils-a" title="Code">💻</a> <a href="https://github.com/cake-contrib/cake.asciidoctorj/commits?author=nils-a" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://twitter.com/hereispascal"><img src="https://avatars1.githubusercontent.com/u/2190718?v=4?s=100" width="100px;" alt="Pascal Berger"/><br /><sub><b>Pascal Berger</b></sub></a><br /><a href="https://github.com/cake-contrib/cake.asciidoctorj/issues?q=author%3Apascalberger" title="Bug reports">🐛</a> <a href="https://github.com/cake-contrib/cake.asciidoctorj/commits?author=pascalberger" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DiDoHH"><img src="https://avatars.githubusercontent.com/u/45682415?v=4?s=100" width="100px;" alt="DiDoHH"/><br /><sub><b>DiDoHH</b></sub></a><br /><a href="https://github.com/cake-contrib/cake.asciidoctorj/commits?author=DiDoHH" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://mcpride.github.io"><img src="https://avatars.githubusercontent.com/u/1053528?v=4?s=100" width="100px;" alt="Marco Stolze"/><br /><sub><b>Marco Stolze</b></sub></a><br /><a href="https://github.com/cake-contrib/cake.asciidoctorj/issues?q=author%3Amcpride" title="Bug reports">🐛</a></td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "7.0.102",
"rollForward": "latestFeature"
}
}
6 changes: 3 additions & 3 deletions src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.18.3" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Shouldly" Version="4.1.0" />
<PackageReference Include="Text.Analyzers" Version="3.3.3">
<PackageReference Include="Text.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
10 changes: 6 additions & 4 deletions src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void Should_convert_all_extensions_to_arguments(Action<AsciiDoctorJRunner
setFlag(sut);

var actual = fixture.EvaluateArgs(sut);
actual.ShouldContain(expectedParam);
actual.ShouldBe(expectedParam);
}

[Theory]
Expand Down Expand Up @@ -71,7 +71,7 @@ private class TestData : IEnumerable<object[]>
yield return (s => s.WithVerbose(), "--verbose");
yield return (s => s.WithTimingsMode(), "--timings");
yield return (s => s.WithSectionNumbers(), "--section-numbers");
yield return (s => s.WithRequire(), "--require");
yield return (s => s.WithRequire("asciidoctor-epub3"), "--require asciidoctor-epub3");
yield return (s => s.WithQuiet(), "--quiet");
yield return (s => s.WithSuppressHeaderAndFooter(), "--no-header-footer");
yield return (s => s.WithCompact(), "--compact");
Expand Down Expand Up @@ -116,7 +116,7 @@ private class TestData : IEnumerable<object[]>
yield return (s => s.WithAttribute("foo", "bar"), "--attribute foo=bar");
yield return (s => s.WithAttributes(new Dictionary<string, string> { { "foo", "bar" }, { "bim", "bam" } }),
"--attribute foo=bar --attribute bim=bam");
yield return (s => s.WithInputFile(new FilePath("/foo.adoc")), "/foo.adoc");
yield return (s => s.WithInputFile(new FilePath("/foo.adoc")), "\"/foo.adoc\"");
yield return (s => s.WithInputFiles(new[] { new FilePath("/foo.adoc"), new FilePath("/bar.adoc") }),
"\"/foo.adoc\" \"/bar.adoc\"");
}
Expand All @@ -140,7 +140,6 @@ private class ArgSetterTestData : IEnumerable<object[]>
yield return (s => s.WithVerbose(), s => s.Verbose, true);
yield return (s => s.WithTimingsMode(), s => s.TimingsMode, true);
yield return (s => s.WithSectionNumbers(), s => s.SectionNumbers, true);
yield return (s => s.WithRequire(), s => s.Require, true);
yield return (s => s.WithQuiet(), s => s.Quiet, true);
yield return (s => s.WithSuppressHeaderAndFooter(), s => s.SuppressHeaderAndFooter, true);
yield return (s => s.WithCompact(), s => s.Compact, true);
Expand Down Expand Up @@ -168,6 +167,7 @@ private class ArgSetterTestData : IEnumerable<object[]>
var barAdoc = new FilePath("bar.adoc");
var fooBar = new KeyValuePair<string, string>("foo", "bar");
var bimBam = new KeyValuePair<string, string>("bim", "bam");
var libs = new[]{"some-library", "another-library"};
yield return (s => s.WithTemplateEngine("some-engine"), s => s.TemplateEngine, "some-engine");
yield return (s => s.WithTemplateDir(fooDir), s => s.TemplateDir, fooDir);
yield return (s => s.WithOutputFile(fooPdf), s => s.Output, fooPdf);
Expand All @@ -184,6 +184,8 @@ private class ArgSetterTestData : IEnumerable<object[]>
yield return (s => s.WithInputFile(fooAdoc), s => s.InputFiles, new[] { fooAdoc });
yield return (s => s.WithInputFiles(new[] { fooAdoc, barAdoc }), s => s.InputFiles,
new[] { fooAdoc, barAdoc });
yield return (s => s.WithRequire(libs), s => s.Require, libs);

}

public IEnumerator<object[]> GetEnumerator()
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ private class TestData : IEnumerable<object[]>
yield return (s => s.Verbose = true, "--verbose");
yield return (s => s.TimingsMode = true, "--timings");
yield return (s => s.SectionNumbers = true, "--section-numbers");
yield return (s => s.Require = true, "--require");
yield return (s => s.Quiet = true, "--quiet");
yield return (s => s.SuppressHeaderAndFooter = true, "--no-header-footer");
yield return (s => s.Compact = true, "--compact");
Expand Down Expand Up @@ -70,6 +69,7 @@ private class TestData : IEnumerable<object[]>
yield return (s => s.Backend = "pdf", "--backend pdf");
yield return (s => s.Attributes.Add("foo", "bar"), "--attribute foo=bar");
yield return (s => s.InputFiles.Add(new FilePath("/foo.adoc")), "\"/foo.adoc\"");
yield return (s => s.Require.Add("asciidoctor-diagram"), "--require asciidoctor-diagram");
}

public IEnumerator<object[]> GetEnumerator()
Expand Down
7 changes: 4 additions & 3 deletions src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public AsciiDoctorJRunnerSettings()
LoadPath = new List<DirectoryPath>();
ClassPath = new List<DirectoryPath>();
Attributes = new Dictionary<string, string>();
Require = new List<string>();
}

/// <summary>
Expand Down Expand Up @@ -82,7 +83,7 @@ public AsciiDoctorJRunnerSettings()
/// require the specified library before executing the processor.
/// <para>corresponds to: -r, --require.</para>
/// </summary>
public bool Require { get; set; }
public IList<string> Require { get; set; }

/// <summary>
/// Gets or sets a value indicating whether to
Expand Down Expand Up @@ -224,9 +225,9 @@ internal void Evaluate(ProcessArgumentBuilder args, ICakeEnvironment environment
// ReSharper enable PossibleNullReferenceException
}

if (Require)
foreach (var req in Require)
{
args.Append("--require");
args.Append("--require " + req);
}

if (Quiet)
Expand Down
5 changes: 3 additions & 2 deletions src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Cake.Core.IO;

Expand Down Expand Up @@ -124,9 +125,9 @@ public static AsciiDoctorJRunnerSettings WithSafeMode(this AsciiDoctorJRunnerSet
/// </summary>
/// <param name="this">The <see cref="AsciiDoctorJRunnerSettings"/> that extended by this.</param>
/// <returns>The reference to the <see cref="AsciiDoctorJRunnerSettings"/>.</returns>
public static AsciiDoctorJRunnerSettings WithRequire(this AsciiDoctorJRunnerSettings @this)
public static AsciiDoctorJRunnerSettings WithRequire(this AsciiDoctorJRunnerSettings @this, params string[] require)
{
@this.Require = true;
require.ToList().ForEach(@this.Require.Add);
return @this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Text.Analyzers" Version="3.3.3">
<PackageReference Include="Text.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 783cca9

Please sign in to comment.