/// <summary> /// Initializes a new instance of the <see cref="GitHubActionsProvider"/> class. /// </summary> /// <param name="environment">The environment.</param> public GitHubActionsProvider(ICakeEnvironment environment) { if (environment == null) { throw new ArgumentNullException(nameof(environment)); } _environment = environment; Environment = new GitHubActionsEnvironmentInfo(environment); }
/// <summary> /// Initializes a new instance of the <see cref="GitHubActionsCommands"/> class. /// </summary> /// <param name="environment">The environment.</param> /// <param name="actionsEnvironment">The actions environment.</param> /// <param name="fileSystem">The file system.</param> /// <param name="createHttpClient">The http client factory.</param> public GitHubActionsCommands( ICakeEnvironment environment, IFileSystem fileSystem, GitHubActionsEnvironmentInfo actionsEnvironment, Func <string, HttpClient> createHttpClient) { _environment = environment ?? throw new ArgumentNullException(nameof(environment)); _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); _actionsEnvironment = actionsEnvironment ?? throw new ArgumentNullException(nameof(actionsEnvironment)); _createHttpClient = createHttpClient ?? throw new ArgumentNullException(nameof(createHttpClient)); }
/// <summary> /// Initializes a new instance of the <see cref="GitHubActionsProvider"/> class. /// </summary> /// <param name="environment">The environment.</param> /// <param name="fileSystem">The file system.</param> public GitHubActionsProvider(ICakeEnvironment environment, IFileSystem fileSystem) { _environment = environment ?? throw new ArgumentNullException(nameof(environment)); Environment = new GitHubActionsEnvironmentInfo(environment); Commands = new GitHubActionsCommands(environment, fileSystem, Environment, _ => new System.Net.Http.HttpClient()); }