Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jzablocki committed Aug 16, 2010
0 parents commit cbf03fc
Show file tree
Hide file tree
Showing 46 changed files with 1,459 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
@@ -0,0 +1,12 @@
obj
bin
deploy
deploy/*
_ReSharper.*
*.csproj.user
*.resharper.user
*.resharper
*.suo
*.cache
~$*

15 changes: 15 additions & 0 deletions README.markdown
@@ -0,0 +1,15 @@
Meringue is an ASP.NET MVC application for...
=================================================================================

Please check the project website...

If you have any questions or ideas...

*Things may change...

_Meringue provides:_

* Feature 1
* Feature 2

There will be a wiki...
Binary file added lib/AutoMapper.dll
Binary file not shown.
Binary file added lib/Common.Logging.dll
Binary file not shown.
Binary file added lib/Inflector.Net.dll
Binary file not shown.
Binary file added lib/MongoDB.dll
Binary file not shown.
Binary file added lib/MvcContrib.FluentHtml.dll
Binary file not shown.
Binary file added lib/MvcContrib.Spring.dll
Binary file not shown.
Binary file added lib/MvcContrib.dll
Binary file not shown.
Binary file added lib/Newtonsoft.Json.dll
Binary file not shown.
Binary file added lib/Norm.dll
Binary file not shown.
Binary file added lib/Spring.Core.dll
Binary file not shown.
Binary file added lib/Strongshell.Recoil.Core.dll
Binary file not shown.
Binary file added lib/System.Web.Mvc.dll
Binary file not shown.
Binary file added lib/nunit.framework.dll
Binary file not shown.
56 changes: 56 additions & 0 deletions src/Meringue.sln
@@ -0,0 +1,56 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeringueWeb", "webs\MeringueWeb\MeringueWeb.csproj", "{F8821A25-3DB2-40A1-8D8B-2F126FACF433}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meringue.Core", "components\Meringue.Core\Meringue.Core.csproj", "{E190DC43-812F-46CC-AA68-D81C256659F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meringue.Webs", "components\Meringue.Webs\Meringue.Webs.csproj", "{9150166A-E43B-47B9-B6A3-B24E2205C0A9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meringue.Models", "components\Meringue.Models\Meringue.Models.csproj", "{2E007FC5-D8C1-4824-82BD-28576965F92F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meringue.Models.Tests", "tests\Meringue.Models.Tests\Meringue.Models.Tests.csproj", "{4C76938F-39E1-4367-9B83-082627BA73F2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meringue.Webs.Tests", "tests\Meringue.Webs.Tests\Meringue.Webs.Tests.csproj", "{5A727E2B-65D1-435E-BA32-F9B48642388D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meringue.Core.Tests", "tests\Meringue.Core.Tests\Meringue.Core.Tests.csproj", "{5D4033D2-946F-4287-A619-C383ED78DCD9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8821A25-3DB2-40A1-8D8B-2F126FACF433}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8821A25-3DB2-40A1-8D8B-2F126FACF433}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8821A25-3DB2-40A1-8D8B-2F126FACF433}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8821A25-3DB2-40A1-8D8B-2F126FACF433}.Release|Any CPU.Build.0 = Release|Any CPU
{E190DC43-812F-46CC-AA68-D81C256659F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E190DC43-812F-46CC-AA68-D81C256659F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E190DC43-812F-46CC-AA68-D81C256659F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E190DC43-812F-46CC-AA68-D81C256659F4}.Release|Any CPU.Build.0 = Release|Any CPU
{9150166A-E43B-47B9-B6A3-B24E2205C0A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9150166A-E43B-47B9-B6A3-B24E2205C0A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9150166A-E43B-47B9-B6A3-B24E2205C0A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9150166A-E43B-47B9-B6A3-B24E2205C0A9}.Release|Any CPU.Build.0 = Release|Any CPU
{2E007FC5-D8C1-4824-82BD-28576965F92F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E007FC5-D8C1-4824-82BD-28576965F92F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E007FC5-D8C1-4824-82BD-28576965F92F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E007FC5-D8C1-4824-82BD-28576965F92F}.Release|Any CPU.Build.0 = Release|Any CPU
{4C76938F-39E1-4367-9B83-082627BA73F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C76938F-39E1-4367-9B83-082627BA73F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C76938F-39E1-4367-9B83-082627BA73F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C76938F-39E1-4367-9B83-082627BA73F2}.Release|Any CPU.Build.0 = Release|Any CPU
{5A727E2B-65D1-435E-BA32-F9B48642388D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A727E2B-65D1-435E-BA32-F9B48642388D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A727E2B-65D1-435E-BA32-F9B48642388D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A727E2B-65D1-435E-BA32-F9B48642388D}.Release|Any CPU.Build.0 = Release|Any CPU
{5D4033D2-946F-4287-A619-C383ED78DCD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D4033D2-946F-4287-A619-C383ED78DCD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D4033D2-946F-4287-A619-C383ED78DCD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D4033D2-946F-4287-A619-C383ED78DCD9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
25 changes: 25 additions & 0 deletions src/components/Meringue.Core/Extensions/IEnumerableExtensions.cs
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Meringue.Core.Extensions {
public static class IEnumerableExtensions {

public static void ForEach<T>(this IEnumerable<T> source, Action<T> action) {
foreach (var item in source) {
action(item);
}
}

public static void TryForEach<T>(this IEnumerable<T> source, Action<T> action, Action<Exception> exHandler) {
foreach (var item in source) {
try {
action(item);
} catch (Exception ex) {
exHandler(ex);
}
}
}
}
}
35 changes: 35 additions & 0 deletions src/components/Meringue.Core/Extensions/IntegerExtensions.cs
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Meringue.Core.Extensions {
public static class IntegerExtensions {

/// <summary>
/// Create an array of ints from the lowerBound to upperBound
/// </summary>
/// <param name="lowerBound">Inclusive lower bound</param>
/// <param name="upperBound">Inclusive upper bound</param>
/// <returns></returns>
public static int[] To(this int start, int end) {
int[] ints = null;

if (start < end) {
ints = new int[end];
for (int i = 0; i < end; i++) {
ints[i] = start++;
}
} else if (start > end) {
ints = new int[start];
for (int i = start-1, j=0; i >= 0; i--, j++) {
ints[j] = start--;
}
} else {
ints = new int[] { start };
}

return ints;
}
}
}
39 changes: 39 additions & 0 deletions src/components/Meringue.Core/Extensions/StringExtensions.cs
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Meringue.Core.Extensions {
public static class StringExtensions {

/// <summary>
/// Get a substring of the source string, starting with the first character
/// </summary>
/// <param name="source">Source string</param>
/// <param name="numberOfCharacters">Number of characters to include</param>
/// <returns>New string with the first n characters</returns>
public static string Left(this string source, int numberOfCharacters) {
return source.leftOrRight(numberOfCharacters, 0);
}

/// <summary>
/// Get a substring of the source string, starting with the last character
/// </summary>
/// <param name="source">Source string</param>
/// <param name="numberOfCharacters">Number of characters to include</param>
/// <returns>New string with the last n characters</returns>
public static string Right(this string source, int numberOfCharacters) {
return source.leftOrRight(numberOfCharacters, source.Length - numberOfCharacters);
}


//trims left or right based on starting point
private static string leftOrRight(this string source, int numberOfCharacters, int whereToStart) {
if (source.Length < numberOfCharacters || source.Length == 0) {
return source;
} else {
return source.Substring(whereToStart, numberOfCharacters);
}
}
}
}
56 changes: 56 additions & 0 deletions src/components/Meringue.Core/Meringue.Core.csproj
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E190DC43-812F-46CC-AA68-D81C256659F4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Meringue.Core</RootNamespace>
<AssemblyName>Meringue.Core</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Extensions\IEnumerableExtensions.cs" />
<Compile Include="Extensions\IntegerExtensions.cs" />
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 36 additions & 0 deletions src/components/Meringue.Core/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Meringue.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Meringue.Core")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8fd1ab84-7847-43fb-a3ae-3a92b7c7ccde")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
63 changes: 63 additions & 0 deletions src/components/Meringue.Models/Meringue.Models.csproj
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2E007FC5-D8C1-4824-82BD-28576965F92F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Meringue.Models</RootNamespace>
<AssemblyName>Meringue.Models</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Norm">
<HintPath>..\..\..\lib\Norm.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MongoServer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Meringue.Core\Meringue.Core.csproj">
<Project>{E190DC43-812F-46CC-AA68-D81C256659F4}</Project>
<Name>Meringue.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
33 changes: 33 additions & 0 deletions src/components/Meringue.Models/MongoServer.cs
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Norm;
using Meringue.Core.Extensions;

namespace Meringue.Models {
public class MongoServer {

private readonly string _connectionString = null;

public MongoServer() {

//TODO: obviously shouldn't be localhost only
_connectionString = "mongodb://localhost/admin";
}

public IList<string> GetDatabases() {

using (IMongo mongo = Mongo.Create(_connectionString)) {

List<string> databases = new List<string>();
using (MongoAdmin admin = new MongoAdmin(_connectionString)) {
admin.GetAllDatabases().ForEach(d => databases.Add(d.Name));
}

return databases;
}

}
}
}

0 comments on commit cbf03fc

Please sign in to comment.