From d775b31f8abde811fc764acf06946963405aa1ab Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Fri, 14 Aug 2020 21:45:03 +0200 Subject: [PATCH] Make FileLinkSettings builder public. (#206) There are use cases where direct access to FileLinkSettings would be helpful (e.g. for test cases in addins). --- src/Cake.Issues/FileLinkSettings.cs | 34 +++++++++---------- .../AzureDevOpsFileLinkSettingsBuilder.cs | 2 +- .../FileLinkOptionalSettingsBuilder.cs | 2 +- .../GitHubFileLinkSettingsBuilder.cs | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Cake.Issues/FileLinkSettings.cs b/src/Cake.Issues/FileLinkSettings.cs index 75e60f370..c1c54fcc3 100644 --- a/src/Cake.Issues/FileLinkSettings.cs +++ b/src/Cake.Issues/FileLinkSettings.cs @@ -22,19 +22,6 @@ internal FileLinkSettings(Func, Uri> builder this.builder = builder; } - /// - /// Returns the URL to the file on the source code hosting system - /// for the issue . - /// - /// Issue for which the link should be returned. - /// URL to the file on the source code hosting system. - public Uri GetFileLink(IIssue issue) - { - issue.NotNull(nameof(issue)); - - return this.builder(issue, new Dictionary()); - } - /// /// Returns settings to link files based on a custom pattern. /// @@ -42,7 +29,7 @@ public Uri GetFileLink(IIssue issue) /// See /// for a list of tokens supported in the pattern. /// File link settings. - internal static FileLinkSettings ForPattern(string pattern) + public static FileLinkSettings ForPattern(string pattern) { pattern.NotNullOrWhiteSpace(nameof(pattern)); @@ -59,7 +46,7 @@ internal static FileLinkSettings ForPattern(string pattern) /// /// Callback called for building the file link. /// File link settings. - internal static FileLinkSettings ForAction(Func builder) + public static FileLinkSettings ForAction(Func builder) { builder.NotNull(nameof(builder)); @@ -72,7 +59,7 @@ internal static FileLinkSettings ForAction(Func builder) /// Full URL of the Git repository, /// eg. https://github.com/cake-contrib/Cake.Issues. /// Builder class for the settings. - internal static GitHubFileLinkSettingsBuilder ForGitHub(Uri repositoryUrl) + public static GitHubFileLinkSettingsBuilder ForGitHub(Uri repositoryUrl) { repositoryUrl.NotNull(nameof(repositoryUrl)); @@ -85,11 +72,24 @@ internal static GitHubFileLinkSettingsBuilder ForGitHub(Uri repositoryUrl) /// Full URL of the Git repository, /// e.g. https://dev.azure.com/myorganization/_git/myrepo. /// Builder class for the settings. - internal static AzureDevOpsFileLinkSettingsBuilder ForAzureDevOps(Uri repositoryUrl) + public static AzureDevOpsFileLinkSettingsBuilder ForAzureDevOps(Uri repositoryUrl) { repositoryUrl.NotNull(nameof(repositoryUrl)); return new AzureDevOpsFileLinkSettingsBuilder(repositoryUrl); } + + /// + /// Returns the URL to the file on the source code hosting system + /// for the issue . + /// + /// Issue for which the link should be returned. + /// URL to the file on the source code hosting system. + public Uri GetFileLink(IIssue issue) + { + issue.NotNull(nameof(issue)); + + return this.builder(issue, new Dictionary()); + } } } diff --git a/src/Cake.Issues/FileLinking/AzureDevOpsFileLinkSettingsBuilder.cs b/src/Cake.Issues/FileLinking/AzureDevOpsFileLinkSettingsBuilder.cs index 74e5a3f27..1351a7f58 100644 --- a/src/Cake.Issues/FileLinking/AzureDevOpsFileLinkSettingsBuilder.cs +++ b/src/Cake.Issues/FileLinking/AzureDevOpsFileLinkSettingsBuilder.cs @@ -6,7 +6,7 @@ /// /// Class for building settings for file links of files hosted on Azure DevOps. /// - internal class AzureDevOpsFileLinkSettingsBuilder + public class AzureDevOpsFileLinkSettingsBuilder { private readonly Uri repositoryUrl; diff --git a/src/Cake.Issues/FileLinking/FileLinkOptionalSettingsBuilder.cs b/src/Cake.Issues/FileLinking/FileLinkOptionalSettingsBuilder.cs index d193b9d03..f8a776144 100644 --- a/src/Cake.Issues/FileLinking/FileLinkOptionalSettingsBuilder.cs +++ b/src/Cake.Issues/FileLinking/FileLinkOptionalSettingsBuilder.cs @@ -6,7 +6,7 @@ /// /// Class containing builder for optional settings for linking to files. /// - internal class FileLinkOptionalSettingsBuilder : FileLinkSettings + public class FileLinkOptionalSettingsBuilder : FileLinkSettings { private readonly Func, Uri> builder; diff --git a/src/Cake.Issues/FileLinking/GitHubFileLinkSettingsBuilder.cs b/src/Cake.Issues/FileLinking/GitHubFileLinkSettingsBuilder.cs index ef3b23d53..c8a6f8ccc 100644 --- a/src/Cake.Issues/FileLinking/GitHubFileLinkSettingsBuilder.cs +++ b/src/Cake.Issues/FileLinking/GitHubFileLinkSettingsBuilder.cs @@ -5,7 +5,7 @@ /// /// Class for building settings for file links of files hosted on GitHub. /// - internal class GitHubFileLinkSettingsBuilder + public class GitHubFileLinkSettingsBuilder { private readonly Uri repositoryUrl;