Coder Social home page Coder Social logo

fubucore's People

Contributors

ahjohannessen avatar alistair avatar bardurdam avatar bbehrens avatar bobpace avatar chadmyers avatar coreykaylor avatar drusellers avatar emiaj avatar ewilde avatar garylcoxjr avatar jbogard avatar jeremydmiller avatar jmarnold avatar joshuaflanagan avatar kevm avatar mkmurray avatar mtscout6 avatar pondidum avatar rauhryan avatar roend83 avatar ryanhauert avatar schotime avatar smerrell avatar spascoe avatar staxmanade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fubucore's Issues

HttpFileCollectionWrapper binding fails when uploading files

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.

Add FileSystemExtensions for reliable cleaning

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);
        }
    }
}

Improve TemplateParser handling of missing Keys

@mkmurray and I will get this tackled pretty soon and have a PR for making this friendlier.

  • Figure out approach to warning about or erroring on missing keys
  • Document SettingsProvider usage
  • Document escaping property variables (i.e. {somekey}) and how to escape using {{}}

DependencyGraph usability

The DependencyGraph has poor usability. Do something to make it easier. I'm thinking a bit of an FI like FubuApplication.

FubuException

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?

Add the Url extensions from FubuDocs for url manipulation

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;
    }
}

Add a new ConsoleListener

// 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; } }
}

Redo how BindingResult errors are tracked

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.

Tighten up the locking in the Cache class

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

Alias attribute overrides field name

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.

PassthroughConverter needs to be BindingValue aware

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.

See this discussion on the fubu mailing list

FubuException

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?

Two classes named the same

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.