Skip to content

Commit

Permalink
Updates following review of features and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Philo committed Jun 25, 2018
1 parent da173e8 commit 8345cda
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 67 deletions.
11 changes: 0 additions & 11 deletions VersionAssemblyInfo.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Cake.Npm.Tests/Ci/NpmCiToolTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using Cake.Core.Diagnostics;
using Cake.Npm.Install;
using Cake.Npm.Ci;
using Xunit;

namespace Cake.Npm.Tests.Ci
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Npm.Tests/Set/NpmSetToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Cake.Npm.Tests.Set
{
public class NpmSetToolTests
{
public sealed class TheAutomatedInstallMethod
public sealed class TheSetMethod
{
[Fact]
public void Should_Redirect_Standard_Error()
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Npm.Tests/Update/NpmUpdateToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Cake.Npm.Tests.Update
{
public class NpmUpdateToolTests
{
public sealed class TheAutomatedInstallMethod
public sealed class TheUpdateMethod
{
[Fact]
public void Should_Redirect_Standard_Error()
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Npm.Tests/Version/NpmVersionToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Cake.Npm.Tests.Version
{
public class NpmVersionToolTests
{
public sealed class TheAutomatedInstallMethod
public sealed class TheVersionMethod
{
[Fact]
public void Should_Throw_If_Settings_Are_Null()
Expand Down
5 changes: 1 addition & 4 deletions src/Cake.Npm/Ci/NpmCiSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ public NpmCiSettings()
/// </summary>
public bool Production { get; set; }

/// <summary>
/// Evaluates the settings and writes them to <paramref name="args"/>.
/// </summary>
/// <param name="args">The argument builder into which the settings should be written.</param>
/// <inheritdoc />
protected override void EvaluateCore(ProcessArgumentBuilder args)
{
base.EvaluateCore(args);
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Npm/Ci/NpmCiSettingsExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Cake.Npm.Ci;

namespace Cake.Npm.Install
namespace Cake.Npm.Ci
{
using System;
using Core;
Expand Down
48 changes: 48 additions & 0 deletions src/Cake.Npm/Namespaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,51 @@ internal class NamespaceDoc
{
}
}

// ReSharper disable once CheckNamespace
namespace Cake.Npm.Ci
{
/// <summary>
/// This namespace contain types used for install npm packages (using CI commands).
/// </summary>
[CompilerGenerated]
internal class NamespaceDoc
{
}
}

// ReSharper disable once CheckNamespace
namespace Cake.Npm.Set
{
/// <summary>
/// This namespace contain types used for managing npm config settings.
/// </summary>
[CompilerGenerated]
internal class NamespaceDoc
{
}
}

// ReSharper disable once CheckNamespace
namespace Cake.Npm.Version
{
/// <summary>
/// This namespace contain types used for determining installed npm version.
/// </summary>
[CompilerGenerated]
internal class NamespaceDoc
{
}
}

// ReSharper disable once CheckNamespace
namespace Cake.Npm.Update
{
/// <summary>
/// This namespace contain types used for updating npm packages.
/// </summary>
[CompilerGenerated]
internal class NamespaceDoc
{
}
}
7 changes: 3 additions & 4 deletions src/Cake.Npm/NpmSetAliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ public static void NpmSet(this ICakeContext context, string key, string value, b
/// </summary>
/// <param name="context">The context.</param>
/// <param name="settings">The settings.</param>
/// <param name="key">The key</param>
/// <param name="value">The value</param>
/// <param name="globally">Set globally</param>
/// <example>
/// <para>Use speSetfic log level ('npm Set')</para>
/// <code>
/// <![CDATA[
/// var settings = new NpmSetSettings();
/// NpmSet(settings, "progress", "false", true);
/// settings.Key = "progress";
/// settings.Value = "false";
/// NpmSet(settings);
/// ]]>
/// </code>
/// </example>
Expand Down
4 changes: 2 additions & 2 deletions src/Cake.Npm/NpmUpdateAliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ public static void NpmUpdate(this ICakeContext context)
}

/// <summary>
/// Updates packages using the speUpdatefied settings.
/// Updates all packages for the project in the current working directory.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="settings">The settings.</param>
/// <example>
/// <para>Use speUpdatefic log level ('npm Update')</para>
/// <code>
/// <![CDATA[
/// var settings = new NpmUpdateSettings();
/// settings.UpdateGlobalPackages();
/// NpmUpdate(settings);
/// ]]>
/// </code>
Expand Down
37 changes: 3 additions & 34 deletions src/Cake.Npm/NpmVersionAliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static class NpmVersionAliases
/// <example>
/// <code>
/// <![CDATA[
/// NpmVersion();
/// var versionString = NpmVersion();
/// ]]>
/// </code>
/// </example>
Expand All @@ -32,40 +32,9 @@ public static string NpmVersion(this ICakeContext context)
throw new ArgumentNullException(nameof(context));
}

return context.NpmVersion(new NpmVersionSettings());
}

/// <summary>
/// Versions packages using the speVersionfied settings.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="settings">The settings.</param>
/// <example>
/// <para>Use speVersionfic log level ('npm Version')</para>
/// <code>
/// <![CDATA[
/// var settings = new NpmVersionSettings();
/// NpmVersion(settings);
/// ]]>
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("Version")]
public static string NpmVersion(this ICakeContext context, NpmVersionSettings settings)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}

if (settings == null)
{
throw new ArgumentNullException(nameof(settings));
}

AddinInformation.LogVersionInformation(context.Log);
var VersionTool = new NpmVersionTool(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log);
return VersionTool.Version(settings);
var settings =new NpmVersionSettings();
return new NpmVersionTool(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log).Version(settings);
}
}
}
2 changes: 1 addition & 1 deletion src/Cake.Npm/Set/NpmSetSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public NpmSetSettings()
/// </summary>
public bool Global { get; set; }

/// <inheritdoc cref="NpmSettings.EvaluateCore" />
/// <inheritdoc />
protected override void EvaluateCore(ProcessArgumentBuilder args)
{
if (string.IsNullOrWhiteSpace(Key))
Expand Down
9 changes: 3 additions & 6 deletions src/Cake.Npm/Update/NpmUpdateSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ public NpmUpdateSettings()
/// <summary>
/// Gets a value indicating whether to update globally installed packages.
/// </summary>
public bool Global { get; internal set; }

/// <summary>
/// Evaluates the settings and writes them to <paramref name="args"/>.
/// </summary>
/// <param name="args">The argument builder into which the settings should be written.</param>
public bool Global { get; internal set; }

/// <inheritdoc />
protected override void EvaluateCore(ProcessArgumentBuilder args)
{
base.EvaluateCore(args);
Expand Down

0 comments on commit 8345cda

Please sign in to comment.