Permalink
Browse files

Adding WebActivator, updatign Nuget package

  • Loading branch information...
1 parent 59483f0 commit bb42e217ecb9e846a1f5883ceb4c27578a454ef3 @skroonenburg skroonenburg committed Nov 6, 2011
@@ -4,7 +4,6 @@
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
-using Rejuicer;
namespace MvcDemo
{
@@ -27,10 +26,12 @@ public static void RegisterRoutes(RouteCollection routes)
public static void ConfigureRejuicer()
{
- OnRequest.ForJs("~/Combined-{0}.js")
+ /*OnRequest.ForJs("~/Combined-{0}.js")
.Compact
.FilesIn("~/Scripts/")
- .Matching("jquery-*.js")
+ .Matching("*.js")
+ .FilesIn("~/Scripts/")
+ .Matching("*.coffee")
.Configure();
OnRequest.ForCss("~/Combined.css")
@@ -41,7 +42,7 @@ public static void ConfigureRejuicer()
OnRequest.ForImage("~/CachedImage-{0}.png")
.Combine
.File("~/Content/transformedUrlImage.png")
- .Configure();
+ .Configure();*/
}
protected void Application_Start()
@@ -39,10 +39,6 @@
<HintPath>..\..\..\..\Lib\EcmaScript.NET.modified.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
- <Reference Include="Rejuicer, Version=1.1.1.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Lib\Rejuicer.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
@@ -117,6 +113,9 @@
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="Scripts\example.coffee" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -0,0 +1,3 @@
+square = (x) -> x * x
+cube = (x) -> square(x) * x
+alert square 3
@@ -1,17 +1,12 @@
-<?xml version="1.0"?>
-
+<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
-
<configuration>
<connectionStrings>
- <add name="ApplicationServices"
- connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
- providerName="System.Data.SqlClient" />
+ <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
-
<system.web>
<compilation debug="false" targetFramework="4.0">
<assemblies>
@@ -20,40 +15,31 @@
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
-
<httpModules>
<add name="Rejuicer" type="Rejuicer.RejuicerModule, Rejuicer" />
</httpModules>
-
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
-
<membership>
<providers>
- <clear/>
- <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
- enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
- maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
- applicationName="/" />
+ <clear />
+ <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
-
<profile>
<providers>
- <clear/>
+ <clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
-
<roleManager enabled="false">
<providers>
- <clear/>
+ <clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
-
<pages>
<namespaces>
<add namespace="System.Web.Mvc" />
@@ -64,14 +50,12 @@
</namespaces>
</pages>
</system.web>
-
<system.webServer>
- <validation validateIntegratedModeConfiguration="false"/>
+ <validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
- <add name="Rejuicer" type="Rejuicer.RejuicerModule, Rejuicer"/>
+ <add name="Rejuicer" type="Rejuicer.RejuicerModule, Rejuicer" />
</modules>
</system.webServer>
-
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
@@ -80,5 +64,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
-</configuration>
-
+</configuration>
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,26 @@
+using Rejuicer.Nuget;
+
+[assembly: WebActivator.PostApplicationStartMethod(typeof($rootnamespace$.App_Start.RejuicerContent), "Configure")]
+namespace $rootnamespace$.App_Start
+{
+ public static class RejuicerContent
+ {
+ public static void Configure()
+ {
+ /*
+ OnRequest.ForJs("~/Combined-{0}.js")
+ .Compact
+ .FilesIn("~/Scripts/")
+ .Matching("*.js")
+ .FilesIn("~/Scripts/") // Include coffee script, these will be automatically compiled to javascript
+ .Matching("*.coffee")
+ .Configure();
+
+ OnRequest.ForCss("~/Combined.css")
+ .Compact
+ .File("~/Content/Site.css")
+ .Configure();
+ */
+ }
+ }
+}
@@ -12,11 +12,12 @@
<dependencies>
<dependency id="YUICompressor.NET" version="1.5.0.0" />
+ <dependency id="WebActivator" version="1.5" />
</dependencies>
</metadata>
<files>
- <file src="..\..\NET40\Source\Rejuicer\Rejuicer\bin\Release\Rejuicer.dll" target="lib\40\Rejuicer.dll" />
- <file src="..\..\NET35\Source\Rejuicer\Rejuicer\bin\Release\Rejuicer.dll" target="lib\35\Rejuicer.dll" />
+ <file src="..\..\NET40\Source\Rejuicer\Rejuicer\bin\Release\Rejuicer.dll" target="lib\40\Rejuicer.dll" />
+ <file src="..\..\NET35\Source\Rejuicer\Rejuicer\bin\Release\Rejuicer.dll" target="lib\35\Rejuicer.dll" />
<file src="web.config.transform" target="Content\web.config.transform" />
</files>
</package>
Binary file not shown.
Binary file not shown.
@@ -6,9 +6,8 @@
namespace Rejuicer.Engine
{
- public static class StreamUtilities
+ public static class ByteUtilities
{
-
public static byte[] CloneBytes(this byte[] input)
{
return (byte[])input.Clone();
@@ -53,7 +53,7 @@ private static void context_BeginRequest(object sender, EventArgs e)
}
if (HttpRuntime.UsingIntegratedPipeline &&
- result.LastModifiedDate.Equals(request.Headers["If-Modified-Since"]))
+ result.LastModifiedDate.ToString().Equals(request.Headers["If-Modified-Since"]))
{
response.StatusCode = 304;
}
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using Rejuicer.Model;
+
+namespace Rejuicer.Engine.Transformers
+{
+ class CoffeeScriptJsTransformer : IFileTransformer
+ {
+ public byte[] TransformFile(PhysicalFileSource source, byte[] file)
+ {
+ var extension = Path.GetExtension(source.VirtualPath);
+
+ if (extension != null && extension.ToUpperInvariant() == ".COFFEE")
+ {
+ return new CoffeeSharp.CoffeeScriptEngine().Compile(file.ReadString()).AsBytes();
+ }
+
+ return file;
+ }
+ }
+}
@@ -67,7 +67,7 @@ public byte[] TransformFile(PhysicalFileSource source, byte[] inputContent)
{
// Create a configuration for this file
OnRequest.ForImage(virtualPath)
- .Combine
+ .Compact
.File(virtualPath.Replace(RejuicerConfigurationSource.FilenameUniquePlaceholder, ""))
.Configure();
}
@@ -39,9 +39,15 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="CoffeeSharp">
+ <HintPath>..\Lib\CoffeeSharp.dll</HintPath>
+ </Reference>
<Reference Include="EcmaScript.NET.modified, Version=0.1.1.0, Culture=neutral, PublicKeyToken=7d53ba4f537753a5, processorArchitecture=MSIL">
<HintPath>..\packages\YUICompressor.NET.1.5.0.0\lib\NET35\EcmaScript.NET.modified.dll</HintPath>
</Reference>
+ <Reference Include="Jurassic">
+ <HintPath>..\Lib\Jurassic.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
@@ -64,18 +70,19 @@
<Compile Include="Engine\ImageMinificationProvider.cs" />
<Compile Include="Engine\Log.cs" />
<Compile Include="Engine\PhysicalFileRegister.cs" />
+ <Compile Include="Engine\Transformers\CoffeeScriptJsTransformer.cs" />
<Compile Include="Model\IPhysicalFileDependency.cs" />
- <Compile Include="Engine\JsMinificationProvider.cs" />
- <Compile Include="Engine\CssMinificationProvider.cs" />
- <Compile Include="Engine\DefaultCssTransformer.cs" />
+ <Compile Include="Engine\MinificationProviders\JsMinificationProvider.cs" />
+ <Compile Include="Engine\MinificationProviders\CssMinificationProvider.cs" />
+ <Compile Include="Engine\Transformers\DefaultCssTransformer.cs" />
<Compile Include="Engine\FileTransformationPipeline.cs" />
<Compile Include="Engine\FileTransformerRegistry.cs" />
<Compile Include="Engine\ICacheProvider.cs" />
<Compile Include="Engine\IFileTransformer.cs" />
<Compile Include="Engine\IMinificationProvider.cs" />
<Compile Include="Engine\MinificationRegistry.cs" />
<Compile Include="Engine\OutputContent.cs" />
- <Compile Include="Engine\StreamUtilities.cs" />
+ <Compile Include="Engine\ByteUtilities.cs" />
<Compile Include="HtmlHelpers\IncludesCacheModel.cs" />
<Compile Include="HtmlHelpers\Rejuicer.cs" />
<Compile Include="Model\IContentSource.cs" />

0 comments on commit bb42e21

Please sign in to comment.