Permalink
Browse files

enough xml comments for now

  • Loading branch information...
jeremydmiller committed Jan 8, 2013
1 parent ba69616 commit ec12504ff36434004dfb183193688fdaa98240df
@@ -186,7 +186,6 @@
<Compile Include="Registration\SettingReplacement.cs" />
<Compile Include="Registration\SettingsCollection.cs" />
<Compile Include="Resources\Etags\IHeadersCache.cs" />
- <Compile Include="Runtime\AboutEndpoint.cs" />
<Compile Include="Runtime\Files\ContentFolder.cs" />
<Compile Include="Runtime\Files\FubuApplicationFiles.cs" />
<Compile Include="Runtime\Files\FubuFile.cs" />
@@ -1,15 +0,0 @@
-using FubuCore.Descriptions;
-using FubuMVC.Core.Diagnostics;
-
-namespace FubuMVC.Core.Runtime
-{
- public class AboutEndpoint
- {
- public string get__about()
- {
- return FubuApplicationDescriber.WriteDescription();
- }
-
-
- }
-}
@@ -24,11 +24,6 @@ public string GetApplicationPath()
return FubuMvcPackageFacility.GetApplicationPath();
}
- public IEnumerable<ContentFolder> Folders
- {
- get { return _folders.Value; }
- }
-
// I'm okay with this finding nulls
public IEnumerable<IFubuFile> FindFiles(FileSet fileSet)
@@ -3,14 +3,36 @@
namespace FubuMVC.Core.Runtime.Files
{
+ /// <summary>
+ /// Provides an abstraction to find files across the main application and all
+ /// Bottles loaded into this application
+ /// </summary>
public interface IFubuApplicationFiles
{
+ /// <summary>
+ /// Tells you the directory of the main application
+ /// </summary>
+ /// <returns></returns>
string GetApplicationPath();
+ /// <summary>
+ /// All the folders in the current server that contain content for the running
+ /// FubuMVC application
+ /// </summary>
IEnumerable<ContentFolder> AllFolders { get; }
- IEnumerable<ContentFolder> Folders { get; }
+
+ /// <summary>
+ /// Find files by FileSet across the application and all Bottles
+ /// </summary>
+ /// <param name="fileSet"></param>
+ /// <returns></returns>
IEnumerable<IFubuFile> FindFiles(FileSet fileSet);
+ /// <summary>
+ /// Finds a file by relative name across the application and all Bottles
+ /// </summary>
+ /// <param name="relativeName"></param>
+ /// <returns></returns>
IFubuFile Find(string relativeName);
}
}
@@ -6,11 +6,41 @@ namespace FubuMVC.Core.Runtime.Files
public interface IFubuFile
{
string Path { get; }
+
+ /// <summary>
+ /// Name of the Bottle that contains this file or "application" if the file is found in
+ /// the main application content folder
+ /// </summary>
string Provenance { get; }
+
+ /// <summary>
+ /// Content folder of the parent Bottle or application content folder where this file
+ /// was found
+ /// </summary>
string ProvenancePath { get; set; }
+
+ /// <summary>
+ /// Path relative to the containing content folder
+ /// </summary>
string RelativePath { get; set; }
+
+ /// <summary>
+ /// Read the contents of this IFubuFile
+ /// </summary>
+ /// <returns></returns>
string ReadContents();
+
+ /// <summary>
+ /// Read the contents of this IFubuFile from a stream
+ /// </summary>
+ /// <param name="action"></param>
void ReadContents(Action<Stream> action);
+
+ /// <summary>
+ /// Reads the text of this file and calls read on
+ /// ever line of the file
+ /// </summary>
+ /// <param name="read"></param>
void ReadLines(Action<string> read);
}
}
@@ -6,19 +6,77 @@
namespace FubuMVC.Core.Runtime
{
+ /// <summary>
+ /// Primary model bag scoped per request. IFubuRequest is the primary way to share state between behaviors
+ /// in a running behavior chain
+ /// </summary>
public interface IFubuRequest
{
+ /// <summary>
+ /// Find a model of the exact type T. If there is not already a known instance of T, IFubuRequest will attempt to
+ /// use model binding against the current request data to resolve a T
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <returns></returns>
T Get<T>() where T : class;
+
+ /// <summary>
+ /// Find a model of the exact type. If there is not already a known instance of T, IFubuRequest will attempt to
+ /// use model binding against the current request data to resolve a T
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
object Get(Type type);
+
+ /// <summary>
+ /// Stores a value of type T in the FubuRequest
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="target"></param>
void Set<T>(T target) where T : class;
+
+ /// <summary>
+ /// Stores a value of type T in the FubuRequest
+ /// </summary>
+ /// <param name="type"></param>
+ /// <param name="target"></param>
void Set(Type type, object target);
IEnumerable<ConvertProblem> ProblemsFor<T>();
+
+ /// <summary>
+ /// Attempts to find the first existing object in this FubuRequest that can be cast to
+ /// type T. Can return null.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <returns></returns>
IEnumerable<T> Find<T>() where T : class;
+
+ /// <summary>
+ /// Has an object of type T already been resolved?
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <returns></returns>
bool Has<T>();
+
+ /// <summary>
+ /// Has an object of this type already been resolved?
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
bool Has(Type type);
+
+ /// <summary>
+ /// Stores the object as object.GetType()
+ /// </summary>
+ /// <param name="input"></param>
void SetObject(object input);
- void Clear(Type getType);
+
+ /// <summary>
+ /// Removes any object stored as Type type
+ /// </summary>
+ /// <param name="type"></param>
+ void Clear(Type type);
}
@@ -6,23 +6,76 @@
namespace FubuMVC.Core.Runtime
{
+ /// <summary>
+ /// Primary abstraction to write to the Http response
+ /// </summary>
public interface IOutputWriter : IDisposable
{
+ /// <summary>
+ /// Write the contents of a file to the Http response body with the Content-Type header and display name header
+ /// </summary>
+ /// <param name="contentType"></param>
+ /// <param name="localFilePath"></param>
+ /// <param name="displayName"></param>
void WriteFile(string contentType, string localFilePath, string displayName);
+
+ /// <summary>
+ /// Write string content to the response body with the designated contentType mimetype (e.g., "text/html")
+ /// </summary>
+ /// <param name="contentType"></param>
+ /// <param name="renderedOutput"></param>
void Write(string contentType, string renderedOutput);
+ /// <summary>
+ /// Writes string content to the response body
+ /// </summary>
+ /// <param name="renderedOutput"></param>
void Write(string renderedOutput);
-
+ /// <summary>
+ /// Writes a 302 redirect to the url to the request
+ /// </summary>
+ /// <param name="url"></param>
void RedirectToUrl(string url);
+
+ /// <summary>
+ /// Appends a Set-Cookie header to the response
+ /// </summary>
+ /// <param name="cookie"></param>
void AppendCookie(Cookie cookie);
+ /// <summary>
+ /// Appends the named header value to the response
+ /// </summary>
+ /// <param name="key"></param>
+ /// <param name="value"></param>
void AppendHeader(string key, string value);
+ /// <summary>
+ /// Writes to the response body as a stream
+ /// </summary>
+ /// <param name="contentType"></param>
+ /// <param name="output"></param>
void Write(string contentType, Action<Stream> output);
+ /// <summary>
+ /// Writes a response code back to the response
+ /// </summary>
+ /// <param name="status"></param>
+ /// <param name="description"></param>
void WriteResponseCode(HttpStatusCode status, string description = null);
+
+ /// <summary>
+ /// Sets the IOutputWriter to "record" mode in caching scenarios
+ /// </summary>
+ /// <param name="action"></param>
+ /// <returns></returns>
IRecordedOutput Record(Action action);
+
+ /// <summary>
+ /// Replays all recorded output
+ /// </summary>
+ /// <param name="output"></param>
void Replay(IRecordedOutput output);
@@ -89,7 +89,7 @@ public FileReaderEndpoint(IFubuApplicationFiles files)
public string get_folders()
{
- _files.Folders.Each(folder => _writer.WriteLine(folder.Provenance +"|" + folder.Path));
+ _files.AllFolders.Each(folder => _writer.WriteLine(folder.Provenance +"|" + folder.Path));
return _writer.ToString();
}
@@ -198,7 +198,6 @@
<Compile Include="Http\Headers\HttpHeaderValuesTester.cs" />
<Compile Include="Http\HttpRequestHeadersTester.cs" />
<Compile Include="Http\MimeTypeListTester.cs" />
- <Compile Include="Http\MimetypeRequestConditionalTester.cs" />
<Compile Include="Http\RequestHeadersIntegratedTester.cs" />
<Compile Include="Http\RouteDataValuesTester.cs" />
<Compile Include="NewConneg\FormatterWriterTester.cs" />
@@ -1,24 +0,0 @@
-using FubuMVC.Core.Http;
-using FubuTestingSupport;
-using NUnit.Framework;
-
-namespace FubuMVC.Tests.Http
-{
- [TestFixture]
- public class MimetypeRequestConditionalTester
- {
- [Test]
- public void matches_negative()
- {
- var conditional = new MimetypeRequestConditional("text/json", "application/json");
- conditional.Matches("text/plain").ShouldBeFalse();
- }
-
- [Test]
- public void matches_positive()
- {
- var conditional = new MimetypeRequestConditional("text/json", "application/json");
- conditional.Matches("text/json").ShouldBeTrue();
- }
- }
-}

0 comments on commit ec12504

Please sign in to comment.