Giter VIP home page Giter VIP logo

wharrgarbl's People

Contributors

aarondandy avatar

Watchers

 avatar  avatar  avatar

wharrgarbl's Issues

Directory/File Info helpers and extensions

  • Append(string)
  • String extensions like .ToDirectoryInfo
  • methods should take multiple relative parameters: `folder1.File("folder2","fileName.ext")
  • a method like SubDir could take an extra parameter, like bool create
  • In addition to EnumerateFiles there could be EnumerateFileNames
  • Creating or deleting a directory/file sometimes requires waiting
    • Could be nice to have a special overload on DirectoryInfo/DirectoryPath for example to allow for a max wait time, or polling to see if the dead is done
    • A .Delete that does not throw would be good
    • folders.ForEach(d => d.Delete(wait: false)); folders.WaitAll(d => !d.Exists); or something equally horrible could be handy. folders.DeleteAll(recursive: true) could be better though
  • A copy method for paths could be neat, instead of File.Copy(a,b) it could be a.CopyTo(b)

IEnumerable helpers

  • Concat single item: .Concat(x) vs .Concat(new[]{x})
  • easily create collections, even when the parameter may be null MakeList(stuff) vs new List<T>(stuff ?? Enumerable.Empty<T>())
  • ForEach without needing it to be a list, foreach(var thing in stuff) doIt(thing); vs stuff.ForEach(thing => doIt(thing)); or even stuff.ForEach(doIt);
    • Just a void version of select
  • Conditional concat: new[] { "unit", "component" }.ConcatIf(string.IsNullOrWhiteSpace(ci), "accept").Concat("pack")
    • ConcatIf could have a Func version as well
    • string.IsNullOrWhiteSpace(ci) ? new[] { "unit", "component", "pack" } : new[] { "unit", "component", "accept", "pack" } can be less redundant
  • WhereNot

enum helpers

Create a shorter version of (T)Enum.Parse(typeof(T), text, true) also a nullable variant.

File/Directory wrapper and helpers

  • DirectoryInfo and FileInfo abstractions to make working with paths easier.
    • Implicit conversions to string and from string could be handy.
    • typed operator + would be good, can't add two files but can add directory + file or directory + string
    • var artifactDir = buildDir.Parent.SubDir("artifacts");
    • SubDir and File methods should take multiple parameters: folder1.File("folder2","fileName.ext")
    • a method like SubDir could take an extra parameter, like bool create
    • fileInfos.Select(f => f.FullName) could be filePaths.Cast<string>()
    • In addition to EnumerateFiles there could be EnumerateFileNames
  • Creating or deleting a directory/file sometimes requires waiting
    • Could be nice to have a special overload on DirectoryInfo/DirectoryPath for example to allow for a max wait time, or polling to see if the dead is done
    • A .Delete that does not throw would be good
    • folders.ForEach(d => d.Delete(wait: false)); folders.WaitAll(d => !d.Exists); or something equally horrible could be handy. folders.DeleteAll(recursive: true) could be better though
  • A copy method for paths could be neat, instead of File.Copy(a,b) it could be a.CopyTo(b)
  • String extensions like .ToDirectoryPath

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.