From 0fb5980908944360f5a7033ecb47780cdf4fa64d Mon Sep 17 00:00:00 2001 From: yanjustino Date: Mon, 24 May 2021 23:03:21 -0300 Subject: [PATCH] Release 2.1.0 --- src/C4Sharp.Tests/C4Sharp.Tests.csproj | 30 ------------------- src/C4Sharp/C4Sharp.csproj | 2 +- .../Models/Plantuml/PlantumlDiagram.cs | 18 +++++++---- 3 files changed, 14 insertions(+), 36 deletions(-) delete mode 100644 src/C4Sharp.Tests/C4Sharp.Tests.csproj diff --git a/src/C4Sharp.Tests/C4Sharp.Tests.csproj b/src/C4Sharp.Tests/C4Sharp.Tests.csproj deleted file mode 100644 index be49339..0000000 --- a/src/C4Sharp.Tests/C4Sharp.Tests.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - net5.0 - - false - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - diff --git a/src/C4Sharp/C4Sharp.csproj b/src/C4Sharp/C4Sharp.csproj index a2ca637..d620e03 100644 --- a/src/C4Sharp/C4Sharp.csproj +++ b/src/C4Sharp/C4Sharp.csproj @@ -11,7 +11,7 @@ https://github.com/8T4/c4sharp git c4, diagrams - 2.0.0 + 2.1.0 https://github.com/8T4/c4sharp/blob/main/LICENSE true true diff --git a/src/C4Sharp/Models/Plantuml/PlantumlDiagram.cs b/src/C4Sharp/Models/Plantuml/PlantumlDiagram.cs index a2b34e9..af67d15 100644 --- a/src/C4Sharp/Models/Plantuml/PlantumlDiagram.cs +++ b/src/C4Sharp/Models/Plantuml/PlantumlDiagram.cs @@ -10,18 +10,17 @@ namespace C4Sharp.Models.Plantuml /// public static class PlantumlDiagram { - const string standardLibraryBaseUrl = "https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master"; + private const string StandardLibraryBaseUrl = "https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master"; /// /// Create PUML content from Diagram /// /// + /// /// public static string ToPumlString(this Diagram diagram, bool useUrlInclude = false) { - var pumlFileName = $"{diagram.Name}.puml"; - var path = useUrlInclude ? $"{standardLibraryBaseUrl}/{pumlFileName}" - : Path.Join(C4Directory.ResourcesFolderName, pumlFileName); + var path = GetPumlFilePath(diagram, useUrlInclude); var stream = new StringBuilder(); stream.AppendLine($"@startuml {diagram.Slug()}"); @@ -61,6 +60,15 @@ public static string ToPumlString(this Diagram diagram, bool useUrlInclude = fal stream.AppendLine("@enduml"); return stream.ToString(); - } + } + + private static string GetPumlFilePath(this Diagram diagram, bool useUrlInclude) + { + var pumlFileName = $"{diagram.Name}.puml"; + + return useUrlInclude + ? $"{StandardLibraryBaseUrl}/{pumlFileName}" + : Path.Join(C4Directory.ResourcesFolderName, pumlFileName); + } } } \ No newline at end of file