/// <summary>
        /// Initializes a new instance of the <see cref="GitRepositoryIssuesProvider"/> class.
        /// </summary>
        /// <param name="log">The Cake log context.</param>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="environment">The Cake environment.</param>
        /// <param name="processRunner">The process runner.</param>
        /// <param name="toolLocator">The tool locator.</param>
        /// <param name="issueProviderSettings">Settings for the issue provider.</param>
        public GitRepositoryIssuesProvider(
            ICakeLog log,
            IFileSystem fileSystem,
            ICakeEnvironment environment,
            IProcessRunner processRunner,
            IToolLocator toolLocator,
            GitRepositoryIssuesSettings issueProviderSettings)
            : base(log)
        {
            fileSystem.NotNull(nameof(fileSystem));
            environment.NotNull(nameof(environment));
            processRunner.NotNull(nameof(processRunner));
            toolLocator.NotNull(nameof(toolLocator));
            issueProviderSettings.NotNull(nameof(issueProviderSettings));

            this.IssueProviderSettings = issueProviderSettings;
            this.runner = new GitRunner(fileSystem, environment, processRunner, toolLocator);

            this.allFiles =
                new Lazy <IEnumerable <string> >(
                    new Func <IEnumerable <string> >(
                        () => this.GetAllFilesFromRepository()));
            this.textFiles =
                new Lazy <IEnumerable <string> >(
                    new Func <IEnumerable <string> >(
                        () => this.GetTextFilesFromRepository()));
            this.binaryFiles =
                new Lazy <IEnumerable <string> >(
                    new Func <IEnumerable <string> >(
                        () => this.DetermineBinaryFiles(this.allFiles.Value, this.textFiles.Value)));
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SvnInfo"/> class.
        /// </summary>
        /// <param name="environment">The Cake environment.</param>
        /// <param name="clientFactoryMethod">Method to use to initialize a Subversion client.</param>
        public SvnInfo(ICakeEnvironment environment, Func <ISvnClient> clientFactoryMethod) : base(clientFactoryMethod)
        {
            environment.NotNull(nameof(environment));
            clientFactoryMethod.NotNull(nameof(clientFactoryMethod));

            _environment = environment;
        }
コード例 #3
0
ファイル: FtpClient.cs プロジェクト: nick-hoang/Cake.Ftp
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="fileSystem">The filesystem.</param>
        /// <param name="environment">The cake environment.</param>
        /// <param name="ftpService">The FTP Service.</param>
        public FtpClient(IFileSystem fileSystem, ICakeEnvironment environment, IFtpService ftpService)
        {
            fileSystem.NotNull(nameof(fileSystem));
            environment.NotNull(nameof(environment));
            ftpService.NotNull(nameof(ftpService));

            _fileSystem  = fileSystem;
            _environment = environment;
            _ftpService  = ftpService;
            _comparison  = environment.Platform.IsUnix() ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GitRepositoryIssuesProvider"/> class.
        /// </summary>
        /// <param name="log">The Cake log context.</param>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="environment">The Cake environment.</param>
        /// <param name="processRunner">The process runner.</param>
        /// <param name="toolLocator">The tool locator.</param>
        /// <param name="issueProviderSettings">Settings for the issue provider.</param>
        public GitRepositoryIssuesProvider(
            ICakeLog log,
            IFileSystem fileSystem,
            ICakeEnvironment environment,
            IProcessRunner processRunner,
            IToolLocator toolLocator,
            GitRepositoryIssuesSettings issueProviderSettings)
            : base(log)
        {
            fileSystem.NotNull(nameof(fileSystem));
            environment.NotNull(nameof(environment));
            processRunner.NotNull(nameof(processRunner));
            toolLocator.NotNull(nameof(toolLocator));
            issueProviderSettings.NotNull(nameof(issueProviderSettings));

            this.IssueProviderSettings = issueProviderSettings;
            this.runner = new GitRunner(fileSystem, environment, processRunner, toolLocator);
        }