epitools

Useful miscellaneous improvements for base Ruby objects, plus some extra data structures and handy wrappers. You can think of it as a light-weight ActiveSupport.

All epitools modules (and a bunch of Ruby’s stdlib) are loaded on demand with “autoload”, so it’s really fast. (Require this in your .irbrc or .pryrc, and you’ll never have to require another Ruby stdlib module again!)

Enhanced base classes: Enumerable, Hash, String, Array, File, Object, Integer, etc.

Extras:

  • Path (an object-oriented interface to the filesytem – it’s File, Dir, FileUtils, and Pathname all rolled into one!)

  • Browser (a fake browser, with a cache, cookies, download progress bars, plus the rest of the mechanize/nokogiri API you know and love)

  • Colored (enhanced version of defunkt’s colored – adds ANSI colouring methods to String, eg: #red, #green, #light_blue, etc.)

  • TypedStruct (like Struct, but setters always coerce input to a certain type, eg: boolean, integer, etc.)

  • WM (control/query desktop windows in X. Note: ‘wmctrl` must be installed)

  • Sys (system tools – determine operating system, list processes, view network statistics, etc.)

  • Term (a toolbox for making terminal-based scripts – get terminal size, create tables, etc.)

  • Iter (a “stable iterator” – lets you write algorithms that modify the array as you’re iterating; good for clustering.)

  • Rash (a hash which can have Regexps as keys, so that many input keys can map to a single value.)

  • Progressbar (better than the progressbar gem)

  • MimeMagic (a port of the Unix ‘file` utility for automatically recognizing files based on their contents; faster than running `file` on every file if you have to process large batches of files. This is originally from the mimemagic gem by Daniel Mendler, and has been slightly modified and enhanced.)

Installing

gem install epitools

Usage

This is basically a collection of enhancements to the ruby base types (Hash, Array, Enumerable, etc.). To learn how it works, read the specs in spec/*.rb, or check out the rdoc: rdoc.info/gems/epitools/frames

Copyright © 2009-2015 epitron

License

Licensed under the WTFPL2. (See LICENSE for details.)