Skip to content

Commit

Permalink
Updating nuget package versions to v2 (RTM)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Smith committed Apr 25, 2017
1 parent fb46799 commit 2a1d365
Show file tree
Hide file tree
Showing 25 changed files with 149 additions and 144 deletions.
32 changes: 16 additions & 16 deletions Jabberwocky.Library.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
<tags>Jabberwocky.Library, metapackage, Velir, Jabberwocky, Library</tags>

<dependencies>
<dependency id="Jabberwocky.Core" version="2.0.0-beta" />
<dependency id="Jabberwocky.WebApi" version="2.0.0-beta" />
<dependency id="Jabberwocky.WebApi.Sc" version="2.0.0-beta" />
<dependency id="Jabberwocky.Glass" version="2.0.0-beta" />
<dependency id="Jabberwocky.Glass.Mvc" version="2.0.0-beta" />
<dependency id="Jabberwocky.Glass.Autofac" version="2.0.0-beta" />
<dependency id="Jabberwocky.Glass.Autofac.Mvc" version="2.0.0-beta" />
<dependency id="Jabberwocky.Glass.Autofac.WebApi" version="2.0.0-beta" />
<dependency id="Jabberwocky.DependencyInjection" version="2.0.0-beta" />
<dependency id="Jabberwocky.DependencyInjection.Sc" version="2.0.0-beta" />
<dependency id="Jabberwocky.Autofac" version="2.0.0-beta" />
<dependency id="Jabberwocky.Autofac.Extras.MiniProfiler" version="2.0.0-beta" />
<dependency id="Jabberwocky.Autofac.Extras.MiniProfiler.Sc" version="2.0.0-beta" />
<dependency id="Jabberwocky.Autofac.Extras.Log4Net.Sc" version="2.0.0-beta" />
<dependency id="Jabberwocky.Extras.Polly.Sc" version="2.0.0-beta" />
<dependency id="Jabberwocky.Extras.NewRelic.Sc" version="2.0.0-beta" />
<dependency id="Jabberwocky.Core" version="2.0.0" />
<dependency id="Jabberwocky.WebApi" version="2.0.0" />
<dependency id="Jabberwocky.WebApi.Sc" version="2.0.0" />
<dependency id="Jabberwocky.Glass" version="2.0.0" />
<dependency id="Jabberwocky.Glass.Mvc" version="2.0.0" />
<dependency id="Jabberwocky.Glass.Autofac" version="2.0.0" />
<dependency id="Jabberwocky.Glass.Autofac.Mvc" version="2.0.0" />
<dependency id="Jabberwocky.Glass.Autofac.WebApi" version="2.0.0" />
<dependency id="Jabberwocky.DependencyInjection" version="2.0.0" />
<dependency id="Jabberwocky.DependencyInjection.Sc" version="2.0.0" />
<dependency id="Jabberwocky.Autofac" version="2.0.0" />
<dependency id="Jabberwocky.Autofac.Extras.MiniProfiler" version="2.0.0" />
<dependency id="Jabberwocky.Autofac.Extras.MiniProfiler.Sc" version="2.0.0" />
<dependency id="Jabberwocky.Autofac.Extras.Log4Net.Sc" version="2.0.0" />
<dependency id="Jabberwocky.Extras.Polly.Sc" version="2.0.0" />
<dependency id="Jabberwocky.Extras.NewRelic.Sc" version="2.0.0" />
</dependencies>
</metadata>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]

[assembly: InternalsVisibleTo("Jabberwocky.Autofac.Extras.MiniProfiler.Sc")]
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<Compile Include="Pipelines\Mvc\GetRenderer\AddPageEditorWrapper.cs" />
<Compile Include="Pipelines\Mvc\GetRenderer\AddPollyWrapper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Renderer\BaseRendererDecorator.cs" />
<Compile Include="Renderer\CircuitBreakerRendererDecorator.cs" />
<Compile Include="Renderer\ErrorHandlingRendererDecorator.cs" />
<Compile Include="Renderer\PageEditorRendererDecorator.cs" />
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
using Jabberwocky.Extras.Polly.Sc.Renderer;
using Sitecore;
using Sitecore.Mvc.Pipelines.Response.GetRenderer;

namespace Jabberwocky.Extras.Polly.Sc.Pipelines.Mvc.GetRenderer
{
public class AddPageEditorWrapper : GetRendererProcessor
{
public override void Process(GetRendererArgs args)
{
if (args.Result == null) return;
public class AddPageEditorWrapper : GetRendererProcessor
{
public override void Process(GetRendererArgs args)
{
if (args.Result == null) return;

var renderer = args.Result;
var rendering = args.Rendering;
if (rendering == null) return;
var renderer = args.Result;
var rendering = args.Rendering;
if (rendering == null) return;

args.Result = new PageEditorRendererDecorator(renderer, rendering.RenderingItem);
}
}
// Only apply this decorator when in Experience Editor
if (!Context.PageMode.IsExperienceEditor) return;

args.Result = new PageEditorRendererDecorator(renderer, rendering.RenderingItem);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;

namespace Jabberwocky.Extras.Polly.Sc.Renderer
{
public abstract class BaseRendererDecorator : Sitecore.Mvc.Presentation.Renderer
{
private readonly Sitecore.Mvc.Presentation.Renderer _innerRenderer;

protected BaseRendererDecorator(Sitecore.Mvc.Presentation.Renderer innerRenderer)
{
_innerRenderer = innerRenderer ?? throw new ArgumentNullException(nameof(innerRenderer));
}

public override string CacheKey => _innerRenderer.CacheKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,45 @@

namespace Jabberwocky.Extras.Polly.Sc.Renderer
{
public class CircuitBreakerRendererDecorator : Sitecore.Mvc.Presentation.Renderer
{
private readonly Sitecore.Mvc.Presentation.Renderer _innerRenderer;
private readonly RenderingItem _renderingItem;
private readonly IPolicyCacheProvider _cacheProvider;
private readonly IPolicyKeyProvider _keyProvider;
public class CircuitBreakerRendererDecorator : BaseRendererDecorator
{
private readonly Sitecore.Mvc.Presentation.Renderer _innerRenderer;
private readonly RenderingItem _renderingItem;
private readonly IPolicyCacheProvider _cacheProvider;
private readonly IPolicyKeyProvider _keyProvider;

public CircuitBreakerRendererDecorator(Sitecore.Mvc.Presentation.Renderer innerRenderer,
RenderingItem renderingItem,
IPolicyCacheProvider cacheProvider,
IPolicyKeyProvider keyProvider)
{
if (innerRenderer == null) throw new ArgumentNullException(nameof(innerRenderer));
if (renderingItem == null) throw new ArgumentNullException(nameof(renderingItem));
if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
if (keyProvider == null) throw new ArgumentNullException(nameof(keyProvider));
_innerRenderer = innerRenderer;
_renderingItem = renderingItem;
_cacheProvider = cacheProvider;
_keyProvider = keyProvider;
}
public CircuitBreakerRendererDecorator(Sitecore.Mvc.Presentation.Renderer innerRenderer,
RenderingItem renderingItem,
IPolicyCacheProvider cacheProvider,
IPolicyKeyProvider keyProvider) : base(innerRenderer)
{
_innerRenderer = innerRenderer ?? throw new ArgumentNullException(nameof(innerRenderer));
_renderingItem = renderingItem ?? throw new ArgumentNullException(nameof(renderingItem));
_cacheProvider = cacheProvider ?? throw new ArgumentNullException(nameof(cacheProvider));
_keyProvider = keyProvider ?? throw new ArgumentNullException(nameof(keyProvider));
}

public override void Render(TextWriter writer)
{
int numExceptions;
int seconds;
if (!int.TryParse(_renderingItem.InnerItem[FieldConstants.BreakAfterExceptionCount], out numExceptions)
|| !int.TryParse(_renderingItem.InnerItem[FieldConstants.OpenCircuitDurationInSeconds], out seconds))
{
// Could not parse the values to integers, so just pass through
Log.Warn($"Configuration values on rendering '{_renderingItem.ID}' for " +
$"'{FieldConstants.BreakAfterExceptionCount}' or '{FieldConstants.OpenCircuitDurationInSeconds}' were invalid.", this);
public override void Render(TextWriter writer)
{
int numExceptions;
int seconds;
if (!int.TryParse(_renderingItem.InnerItem[FieldConstants.BreakAfterExceptionCount], out numExceptions)
|| !int.TryParse(_renderingItem.InnerItem[FieldConstants.OpenCircuitDurationInSeconds], out seconds))
{
// Could not parse the values to integers, so just pass through
Log.Warn($"Configuration values on rendering '{_renderingItem.ID}' for " +
$"'{FieldConstants.BreakAfterExceptionCount}' or '{FieldConstants.OpenCircuitDurationInSeconds}' were invalid.", this);

_innerRenderer.Render(writer);
return;
}
_innerRenderer.Render(writer);
return;
}

var policyKey = _keyProvider.GetKey(_renderingItem);
var policyKey = _keyProvider.GetKey(_renderingItem);

var policy = _cacheProvider.GetOrAddPolicy(policyKey,
key => Policy.Handle<Exception>().CircuitBreaker(numExceptions, TimeSpan.FromSeconds(seconds)));
var policy = _cacheProvider.GetOrAddPolicy(policyKey,
key => Policy.Handle<Exception>().CircuitBreaker(numExceptions, TimeSpan.FromSeconds(seconds)));

policy.Execute(() => _innerRenderer.Render(writer));
}
}
policy.Execute(() => _innerRenderer.Render(writer));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,28 @@

namespace Jabberwocky.Extras.Polly.Sc.Renderer
{
public class ErrorHandlingRendererDecorator : Sitecore.Mvc.Presentation.Renderer
{
private readonly Sitecore.Mvc.Presentation.Renderer _innerRenderer;
private readonly RenderingItem _renderingItem;
public class ErrorHandlingRendererDecorator : BaseRendererDecorator
{
private readonly Sitecore.Mvc.Presentation.Renderer _innerRenderer;
private readonly RenderingItem _renderingItem;

public ErrorHandlingRendererDecorator(Sitecore.Mvc.Presentation.Renderer innerRenderer, RenderingItem renderingItem)
{
if (innerRenderer == null) throw new ArgumentNullException(nameof(innerRenderer));
if (renderingItem == null) throw new ArgumentNullException(nameof(renderingItem));
_innerRenderer = innerRenderer;
_renderingItem = renderingItem;
}
public ErrorHandlingRendererDecorator(Sitecore.Mvc.Presentation.Renderer innerRenderer, RenderingItem renderingItem)
: base(innerRenderer)
{
_innerRenderer = innerRenderer ?? throw new ArgumentNullException(nameof(innerRenderer));
_renderingItem = renderingItem ?? throw new ArgumentNullException(nameof(renderingItem));
}

public override void Render(TextWriter writer)
{
try
{
_innerRenderer.Render(writer);
}
catch (Exception ex)
{
Log.Warn($"Hiding rendering '{_renderingItem.ID}' due to error.", ex, typeof(ErrorHandlingRendererDecorator));
}
}
}
public override void Render(TextWriter writer)
{
try
{
_innerRenderer.Render(writer);
}
catch (Exception ex)
{
Log.Error($"Hiding rendering '{_renderingItem.ID}' due to error.", ex, typeof(ErrorHandlingRendererDecorator));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,47 +1,36 @@
using System;
using System.IO;
using System.Web;
using Sitecore;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;

namespace Jabberwocky.Extras.Polly.Sc.Renderer
{
public class PageEditorRendererDecorator : Sitecore.Mvc.Presentation.Renderer
{
private readonly Sitecore.Mvc.Presentation.Renderer _innerRenderer;
private readonly RenderingItem _renderingItem;
public class PageEditorRendererDecorator : BaseRendererDecorator
{
private readonly Sitecore.Mvc.Presentation.Renderer _innerRenderer;
private readonly RenderingItem _renderingItem;

public PageEditorRendererDecorator(Sitecore.Mvc.Presentation.Renderer innerRenderer, RenderingItem renderingItem)
{
if (innerRenderer == null) throw new ArgumentNullException(nameof(innerRenderer));
if (renderingItem == null) throw new ArgumentNullException(nameof(renderingItem));
_innerRenderer = innerRenderer;
_renderingItem = renderingItem;
}
public PageEditorRendererDecorator(Sitecore.Mvc.Presentation.Renderer innerRenderer, RenderingItem renderingItem)
: base(innerRenderer)
{
_innerRenderer = innerRenderer ?? throw new ArgumentNullException(nameof(innerRenderer));
_renderingItem = renderingItem ?? throw new ArgumentNullException(nameof(renderingItem));
}

public override void Render(TextWriter writer)
{
// Only bother with capturing exceptions if we're in Experience Editor mode
// No point in catching and immediately rethrowing when not in 'happy path'
if (Context.PageMode.IsExperienceEditor)
{
try
{
_innerRenderer.Render(writer);
}
catch (Exception ex)
{
writer.Write("<p class='page-editor-component-error rendering-name'>Error rendering the following component: {0}</p><p class='page-editor-component-error exception-message'>{1}</p>",
HttpUtility.HtmlEncode(_renderingItem.Name),
HttpUtility.HtmlEncode(ex));
Log.Error(ex.Message, ex, typeof(PageEditorRendererDecorator));
}
}
else
{
_innerRenderer.Render(writer);
}
}
}
public override void Render(TextWriter writer)
{
try
{
_innerRenderer.Render(writer);
}
catch (Exception ex)
{
writer.Write("<p class='page-editor-component-error rendering-name'>Error rendering the following component: {0}</p><p class='page-editor-component-error exception-message'>{1}</p>",
HttpUtility.HtmlEncode(_renderingItem.Name),
HttpUtility.HtmlEncode(ex));
Log.Error(ex.Message, ex, typeof(PageEditorRendererDecorator));
}
}
}
}
2 changes: 1 addition & 1 deletion src/Jabberwocky.Autofac/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
2 changes: 1 addition & 1 deletion src/Jabberwocky.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: InternalsVisibleTo("Jabberwocky.Core.Tests")]
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]

[assembly: InternalsVisibleTo("Jabberwocky.Glass.Autofac.Mvc.Tests")]
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
2 changes: 1 addition & 1 deletion src/Jabberwocky.Glass.Autofac/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]

[assembly: InternalsVisibleTo("Jabberwocky.Glass.Autofac.Mvc")]
[assembly: InternalsVisibleTo("Jabberwocky.Glass.Autofac.WebApi")]
Expand Down
2 changes: 1 addition & 1 deletion src/Jabberwocky.Glass.Mvc/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta")]
[assembly: AssemblyInformationalVersion("2.0.0")]
Loading

0 comments on commit 2a1d365

Please sign in to comment.