Skip to content

Commit

Permalink
Additional Mono/Linux adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahjohannessen authored and RobertTheGrey committed Mar 21, 2011
1 parent 96837b5 commit ef93151
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Spark.Python/Compiler/PythonViewCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public override void GenerateSourceCode(IEnumerable<IList<Chunk>> viewTemplates,
source.AppendLine(" Templates = new string[] {");
source.Append(" ").AppendLine(string.Join(",\r\n ",
Descriptor.Templates.Select(
t => "\"" + t.Replace("\\", "\\\\") + "\"").ToArray()));
t => "\"" + SparkViewAttribute.ConvertToAttributeFormat(t) + "\"").ToArray()));
source.AppendLine(" })]");
}

Expand Down
2 changes: 1 addition & 1 deletion src/Spark.Ruby/Compiler/RubyViewCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public override void GenerateSourceCode(IEnumerable<IList<Chunk>> viewTemplates,
source.AppendLine(" Templates = new string[] {");
source.Append(" ").AppendLine(string.Join(",\r\n ",
Descriptor.Templates.Select(
t => "\"" + t.Replace("\\", "\\\\") + "\"").ToArray()));
t => "\"" + SparkViewAttribute.ConvertToAttributeFormat(t) + "\"").ToArray()));
source.AppendLine(" })]");
}

Expand Down
11 changes: 7 additions & 4 deletions src/Spark.Tests/SparkSectionHandlerTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using NUnit.Framework;
Expand Down Expand Up @@ -80,16 +81,18 @@ public void UseAssemblyAndNamespaceFromSettings()
.AddAssembly("System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
.SetPageBaseType(typeof(StubSparkView));

var views = new InMemoryViewFolder();
views.Add("Home\\Index.spark", "<div>${ProcessStatus.Alive}</div>");
var views = new InMemoryViewFolder
{
{Path.Combine("home", "index.spark"), "<div>${ProcessStatus.Alive}</div>"}
};

var engine = new SparkViewEngine(settings) {ViewFolder = views};

var descriptor = new SparkViewDescriptor();
descriptor.Templates.Add("home\\index.spark");
descriptor.Templates.Add(Path.Combine("home","index.spark"));

var contents = engine.CreateInstance(descriptor).RenderView();
Assert.AreEqual("<div>Alive</div>", contents);
}
}
}
}

0 comments on commit ef93151

Please sign in to comment.