Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'origin/master' into preprocessor-pipeline

Conflicts:
	SquishIt.Framework/Base/BundleBase.cs
	SquishIt.Tests/JavaScriptBundleTests.cs
  • Loading branch information...
commit b24a3a148e70043de80b27062cb2972d672ef9bd 2 parents 0407052 + a984d60
@AlexCuse AlexCuse authored
View
17 SquishIt.Framework/Base/BundleBase.cs
@@ -53,7 +53,7 @@ protected IMinifier<T> Minifier
private static Dictionary<string, BundleState> bundleStateCache = new Dictionary<string, BundleState>();
private IBundleCache bundleCache;
- private IRenderer releaseRenderer;
+ private IRenderer releaseFileRenderer;
protected BundleBase(IFileWriterFactory fileWriterFactory, IFileReaderFactory fileReaderFactory, IDebugStatusReader debugStatusReader, ICurrentDirectoryWrapper currentDirectoryWrapper, IHasher hasher, IBundleCache bundleCache)
{
@@ -67,9 +67,12 @@ protected BundleBase(IFileWriterFactory fileWriterFactory, IFileReaderFactory fi
this.bundleCache = bundleCache;
}
- protected IRenderer GetReleaseFileRenderer()
+ protected IRenderer GetFileRenderer()
{
- return releaseRenderer ?? Configuration.Instance.DefaultReleaseRenderer() ?? new FileRenderer(fileWriterFactory);
+ return debugStatusReader.IsDebuggingEnabled() ? new FileRenderer(fileWriterFactory) :
+ releaseFileRenderer ??
+ Configuration.Instance.DefaultReleaseRenderer() ??
+ new FileRenderer(fileWriterFactory);
}
private List<string> GetFiles(List<Asset> assets)
@@ -342,16 +345,16 @@ public T WithOutputBaseHref(string href)
return (T)this;
}
- public T WithReleaseRenderer(IRenderer renderer)
+ public T WithReleaseFileRenderer(IRenderer renderer)
{
- this.releaseRenderer = renderer;
+ this.releaseFileRenderer = renderer;
return (T) this;
}
public string Render(string renderTo)
{
string key = renderTo;
- return Render(renderTo, key, GetReleaseFileRenderer());
+ return Render(renderTo, key, GetFileRenderer());
}
private string Render(string renderTo, string key, IRenderer renderer)
@@ -413,7 +416,7 @@ public string RenderCachedAssetTag(string name)
public void AsNamed(string name, string renderTo)
{
- Render(renderTo, name, GetReleaseFileRenderer());
+ Render(renderTo, name, GetFileRenderer());
bundleState.Path = renderTo;
bundleStateCache[CachePrefix + name] = bundleState;
}
View
23 SquishIt.Tests/CssBundleTests.cs
@@ -1057,8 +1057,7 @@ public void PathRewritingDoesNotAffectClassesNamedUrl()
}
[Test]
- public void CanUseArbitraryReleaseRenderer()
- {
+ public void CanUseArbitraryReleaseFileRenderer() {
var renderer = new Mock<IRenderer>();
var content = "content";
@@ -1066,7 +1065,7 @@ public void CanUseArbitraryReleaseRenderer()
var tag = cssBundleFactory
.WithDebuggingEnabled(false)
.Create()
- .WithReleaseRenderer(renderer.Object)
+ .WithReleaseFileRenderer(renderer.Object)
.AddString(content)
.Render("test.css");
@@ -1074,6 +1073,22 @@ public void CanUseArbitraryReleaseRenderer()
}
[Test]
+ public void CanIgnoreArbitraryReleaseFileRendererIfDebugging() {
+ var renderer = new Mock<IRenderer>(MockBehavior.Strict);
+
+ var content = "content";
+
+ var tag = cssBundleFactory
+ .WithDebuggingEnabled(true)
+ .Create()
+ .WithReleaseFileRenderer(renderer.Object)
+ .AddString(content)
+ .Render("test.css");
+
+ renderer.VerifyAll();
+ }
+
+ [Test]
public void CanIgnoreArbitraryReleaseRendererInDebug()
{
var renderer = new Mock<IRenderer>();
@@ -1083,7 +1098,7 @@ public void CanIgnoreArbitraryReleaseRendererInDebug()
var tag = cssBundleFactory
.WithDebuggingEnabled(true)
.Create()
- .WithReleaseRenderer(renderer.Object)
+ .WithReleaseFileRenderer(renderer.Object)
.AddString(content)
.Render("test.css");
View
22 SquishIt.Tests/JavaScriptBundleTests.cs
@@ -752,14 +752,14 @@ public void CanBundleJavaScriptWithDeferredLoad()
}
[Test]
- public void CanUseArbitraryReleaseRenderer()
+ public void CanUseArbitraryReleaseFileRenderer()
{
var renderer = new Mock<IRenderer>();
var content = "content";
var tag = javaScriptBundle
- .WithReleaseRenderer(renderer.Object)
+ .WithReleaseFileRenderer(renderer.Object)
.AddString(content)
.ForceRelease()
.Render("test.js");
@@ -768,6 +768,22 @@ public void CanUseArbitraryReleaseRenderer()
}
[Test]
+ public void CanIgnoreArbitraryReleaseFileRendererIfDebugging()
+ {
+ var renderer = new Mock<IRenderer>(MockBehavior.Strict);
+
+ var content = "content";
+
+ var tag = javaScriptBundle
+ .WithReleaseFileRenderer(renderer.Object)
+ .AddString(content)
+ .ForceDebug()
+ .Render("test.js");
+
+ renderer.VerifyAll();
+ }
+
+ [Test]
public void CanIgnoreArbitraryReleaseRendererInDebug()
{
var renderer = new Mock<IRenderer>();
@@ -775,7 +791,7 @@ public void CanIgnoreArbitraryReleaseRendererInDebug()
var content = "content";
var tag = javaScriptBundle
- .WithReleaseRenderer(renderer.Object)
+ .WithReleaseFileRenderer(renderer.Object)
.AddString(content)
.Render("test.js");
View
2  tools/pack-push.bat
@@ -4,5 +4,5 @@ for %%s in (..\nuspec\*.nuspec) do (
)
for %%p in (*.nupkg) do (
nuget push %%p
- rm %%p
+ del %%p
)
Please sign in to comment.
Something went wrong with that request. Please try again.