Fast

DSL for file handling focused in intuitivity and semantics.

Library is pure Ruby 1.8.7, no FileUtils nor other dependencies (except Metafun for DSL delegation)

Installation

Don’t install right now, as 13-09-2011 this is pre-alpha, but in intensive development.

Philosophy

Fast embraces the more straightforward view of files as strings of data and directories as arrays of files/directories. Some arguments:

  • It is more realistic in everyday usage

  • It makes them more object-like (and thus, more friendly to OOP)

  • Is more semantic

  • Files as IOs are still accessible through the harder-to-use native Ruby API

Fast::Dir is a subclass of Array, usable as a hash, and Fast::File if a subclass of String.

Quick notes

  • Move all Fast code to fast/main.rb. Update Metafun/Delegator so it will inject the #delegate method into every Object instance. Reduce the “fast.rb” to a call to external libraries, fast/main and DSLization via #delegate.

  • Describe the SubSetter pattern for filtering.

  • File lists as returned by Fast::Dir#list and Fast::Dir#dirs will be filtered after the list is retrieved by a set of filtering methods of the returned list, which should be an instance of Fast::Dir.

  • An instance of Fast::Dir should be possible to be created from a Array.

  • The path can be setted indirectly by any method of Fast::File instances, and the same works for Dir. This is fine because allows for very quick calls, but once an instance gets a path setted it should be fixed and raise an exception in case some other method call is trying to change it.

Remote future

  • Make Fast a REST client (well, use rest-client) in order to transparently use files and directories from a compliant REST server.

  • Include REST methods: Dir#post, File#get, File#head, etc

  • Allow Files to behave as Dirs with the right method calls

License

GPL License. Why else?

@ Xavier Via