Skip to content

Commit

Permalink
(chocolateyGH-14) Define ISourceRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Jan 24, 2015
1 parent 9a7ac27 commit f1ec25c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/chocolatey/chocolatey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<Compile Include="infrastructure.app\services\IChocolateyConfigSettingsService.cs" />
<Compile Include="infrastructure.app\configuration\ConfigFileApiKeySetting.cs" />
<Compile Include="infrastructure.app\nuget\NugetEncryptionUtility.cs" />
<Compile Include="infrastructure.app\services\ISourceRunner.cs" />
<Compile Include="infrastructure.app\services\ITemplateService.cs" />
<Compile Include="infrastructure.app\domain\ChocolateyPackageInformation.cs" />
<Compile Include="infrastructure.app\domain\CustomInstaller.cs" />
Expand Down Expand Up @@ -159,7 +160,7 @@
<Compile Include="infrastructure.app\ApplicationParameters.cs" />
<Compile Include="infrastructure\commands\ExternalCommandArgsBuilder.cs" />
<Compile Include="infrastructure\commands\ExternalCommandArgument.cs" />
<Compile Include="infrastructure.app\domain\SpecialSourceType.cs" />
<Compile Include="infrastructure.app\domain\SourceType.cs" />
<Compile Include="infrastructure\extractors\AssemblyFileExtractor.cs" />
<Compile Include="infrastructure.app\builders\ConfigurationBuilder.cs" />
<Compile Include="infrastructure.app\commands\ChocolateyListCommand.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace chocolatey.infrastructure.app.domain
/// <summary>
/// Special source modifiers that use alternate sources for packages
/// </summary>
public enum SpecialSourceType
public enum SourceType
{
//this is what it should be when it's not set
normal,
Expand Down
70 changes: 70 additions & 0 deletions src/chocolatey/infrastructure.app/services/ISourceRunner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright © 2011 - Present RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace chocolatey.infrastructure.app.services
{
using System;
using System.Collections.Concurrent;
using configuration;
using domain;
using results;

public interface ISourceRunner
{
/// <summary>
/// Gets the source type the source runner implements
/// </summary>
/// <value>
/// The type of the source.
/// </value>
SourceType SourceType { get; }

/// <summary>
/// Ensures the application that controls a source is installed
/// </summary>
/// <param name="config">The configuration.</param>
/// <param name="ensureAction">The action to continue with as part of the install</param>
void ensure_source_app_installed(ChocolateyConfiguration config, Action<PackageResult> ensureAction);

/// <summary>
/// Run list in noop mode
/// </summary>
/// <param name="config">The configuration.</param>
void list_noop(ChocolateyConfiguration config);

/// <summary>
/// Lists/searches for packages from the source feed
/// </summary>
/// <param name="config">The configuration.</param>
/// <param name="logResults">Should results be logged?</param>
/// <returns></returns>
ConcurrentDictionary<string, PackageResult> list_run(ChocolateyConfiguration config, bool logResults);

/// <summary>
/// Run install in noop mode
/// </summary>
/// <param name="config">The configuration.</param>
/// <param name="continueAction">The action to continue with for each noop test install.</param>
void install_noop(ChocolateyConfiguration config, Action<PackageResult> continueAction);

/// <summary>
/// Installs packages from the source feed
/// </summary>
/// <param name="config">The configuration.</param>
/// <param name="continueAction">The action to continue with when install is successful.</param>
/// <returns>results of installs</returns>
ConcurrentDictionary<string, PackageResult> install_run(ChocolateyConfiguration config, Action<PackageResult> continueAction);
}
}

0 comments on commit f1ec25c

Please sign in to comment.