darthfubumvc / fubucore Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
FubuMVC conventions might be easier to use if all the FubuCore TypeExtensions would just return false if it gets a null type.
Thinking of things like:
type.HasAttribute<>()
type.CanBeCastTo<>()
and so on.
Got lost when property stack was removed. Figure out a way to bring it back
Just cleaner than doing:
description.Children[name] = Description.For(object)
Using Nuget, we installed the Razor view engine (FubuMVC.Razor v0.9.5.817 and RazorEngine v3.0.8) which upgraded the following packages:
Bottles from 0.9.1.202 to 0.9.1.224
FubuCore from 0.9.4.117 to 0.9.8.130
FubuLocalization from 0.9.4.116 to 0.9.5.17
FubuMVC.References from 0.9.4.762 to 0.9.5.817
Now when we upload files the HttpFileCollectionWrapper value on our input model is null.
Downgrading all of the packages and grabbing the older Nuget FubuMVC.Razor -Version 0.9.4.768 fixed things.
public static class FileSystemExtensions
{
// Basic integration coverage on this but having to rely mostly on manual testing here
public static void ForceClean(this IFileSystem system, string path)
{
if (path.IsEmpty()) return;
if (!Directory.Exists(path)) return;
try
{
cleanDirectory(path, false);
}
catch
{
// just retry it
cleanDirectory(path, false);
}
}
private static void cleanDirectory(string directory, bool remove = true)
{
string[] files = Directory.GetFiles(directory);
string[] children = Directory.GetDirectories(directory);
foreach (var file in files)
{
File.SetAttributes(file, FileAttributes.Normal);
File.Delete(file);
}
Thread.Sleep(10);
foreach (var child in children)
{
cleanDirectory(child);
}
if (remove)
{
Thread.Sleep(10);
Directory.Delete(directory, false);
}
}
}
@mkmurray and I will get this tackled pretty soon and have a PR for making this friendlier.
{somekey}
) and how to escape using {{}}
This would be really handy for value types and testing scenarios
If you have an enumerable argument as a 'argument' it shows up as a 'flag'
see bottles bundle
Use the new RequestSource signature when creating the diagnostic report for settings data. Will eliminate new duplication in the code.
Added a bunch of new things to Description. Just more to do.
It's silly, but it would make test setup a lot quicker in many cases
The DependencyGraph has poor usability. Do something to make it easier. I'm thinking a bit of an FI like FubuApplication.
Over and over again we keep using a model where we need to search through assemblies in the application by looking for the actual DLL/EXE files. Centralize this, and get TypePool to FubuCore.
Don't do until 2.0 though.
Still hardcoding "FubuMVC" in message and the namespace is still in FubuMVC.Core - looks like a bad refactoring. Or is this namespace still there to prevent compilation errors in someone's app?
I wants it.
Something almost exactly like what we do for diagnostics for the SettingsData. Gonna want it to explain what happens in model binding.
public static class StringExtensions
{
public static string AppendUrl(this string url, string part)
{
var composite = (url ?? string.Empty).TrimEnd('/') + "/" + part.TrimStart('/');
return composite.TrimEnd('/');
}
public static string ChildUrl(this string url)
{
return url.Split('/').Skip(1).Join("/");
}
public static string ParentUrl(this string url)
{
url = url.Trim('/');
return url.Contains("/") ? url.Split('/').Reverse().Skip(1).Reverse().Join("/") : string.Empty;
}
}
Pretty sure this isn't accommodating deep object graphs because of the period naming thing. Need acceptance tests on it that hit both deep graphs and enumerables
per Alistair's suggestion
// TODO -- this should be in FubuCore. Nice to make a switch for it.
// Maybe use FubuMode?
public class ConsoleListener : ILogListener
{
public bool ListensFor(Type type)
{
return true;
}
public void DebugMessage(object message)
{
}
public void InfoMessage(object message)
{
Console.WriteLine(message);
}
public void Debug(string message)
{
}
public void Info(string message)
{
Console.WriteLine(message);
}
public void Error(string message, Exception ex)
{
Console.WriteLine(message);
Console.WriteLine(ex);
}
public void Error(object correlationId, string message, Exception ex)
{
Console.WriteLine(correlationId);
Error(message, ex);
}
public bool IsDebugEnabled { get { return false; } }
public bool IsInfoEnabled { get { return true; } }
}
Dunno yet. More ctor's? Maybe some static builders?
Causes havoc w/ NuGet right now
Tracking by accessor or PropertyInfo by itself is just going to be too hard. Need a new class to track them and retrieve/query binding errors. Will spill into FubuMVC.Validation too.
Kind of annoying. When we do projections from something like "Source" to "Dto", the property names may be exactly the same, but the underlying type is the same. Like to have a way that FubuLocalization can just forward properties on. We had this at Dovetail way back when
Use bottles ? deploy to reproduce
Today it's just looking at StringToken.Key. That was hunky-dory before we introduced the new, silent namespace by type, but doesn't fly now.
Focus on the basic localization. Hit property headers vis a vis the missing header
Makes Josh's work w/ Object Blocks easier
Putting an extra ".." in.
folder1/file1
folder2/file2
path relative to is getting "....\folder1\file1" instead of "..\folder1\file2"
Need to do some Regex work to get at "Property[0]". Joy.
This is causing people issues because of the double duty
Unit testing a PropertyBinder or a ValueConverter in an integrated fashion is tedious. Do something like the PersistenceSpecification in FNH maybe.
Need to be more aggressive with reader/writer locks in the Cache class. Of course, the last time someone tried to make a fancier locking Cache that damn thing just didn't work. However, I'm an optimist
The alias flag overrides the name of a property, but this feels counter-intuitive. An alias would provide an optional name for a property instead of overriding it. This would be useful when one wants to make "short" and "long" command line flags.
For example
[FlagAlias("z")]
public String ZipFile {get; set;}
Feels like it would allow for this usage
fubu new -zipFile ../../MyZipfile.zip
or
fubu new -z ../../MyZipfile.zip
but at the moment you only get the shorter -z version instead of both options.
Too useful to not be here.
Build a command with:
public IEnumerable OptionsFlag {get;set;}
and do "exe ? command", you don't see the OptionsFlag listed
tracking issue for resolving FubuMVC issue #286. Fubu can't bind the ASP.NET files collection because the PassthroughConverter is returning a BindingValue which the ConversionPropertyBinder is trying to set directly on the input model "Files" property and an exception occurs.
PassthroughConverter needs to be BindingValue-aware and get the raw value out of the BindingValue if necessary.
It's a NotImplementedException at the moment. Will need a pretty wide spread of tests on this too
Still hardcoding "FubuMVC" in message and the namespace is still in FubuMVC.Core - looks like a bad refactoring. Or is this namespace still there to prevent compilation errors in someone's app?
FubuCore.Binding.StatelessConverter
FubuCore.Conversion.StatelessConverter
Both of these classes are named the same. I would suggest renaming FubuCore.Binding.StatelessConverter -> FubuCore.Binding.StatelessBindingConverter.
That said, JDM has pointed out that it would be cheaper (lower impact on others) to instead change 'FubuCore.Conversion.StatelessConverter' but I don't have a name suggestion for it.
Today model binding only supports properties, but what about adding public fields as well? It would cut down on some code noise, especially for the Settings objects.
If you pass a FileSet object with Excludes set, the exclusions are ignored.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.