/tomutil

A gem that has utilities that I like to use

Primary LanguageRuby

This gem contains the TomUtil module:

require 'tomutil/parallel'
include TomUtil

parallel_each(list, &block): A function that runs the associated block each in its own thread for each item in the list.

launch_threads(count, &block): A function that launches N threads with the same block.

prepend_exec(str, exec_str): a function that will execute the exec_str and will prepend it's stdout output with str.

require 'tomutil/padder'
include TomUtil

Padder: a class that I made for padding strings with spaces.  It takes a list of strings and will pad any string to the max of the lengths of the strings in the list.

require 'tomutil/hash'
include TomUtil

Added subset(keys) to Hash.  Pass it a list of keys and you get a new Hash with only those keys and their values in it.

HashComparer: a class for examining two hashes based on their keys.