The Mutagem library provides file based mutexes for recursion protection and classes for threading of external processes with support for output and exit status capturing. A test suite is provided for both unit and functional testing. The code is documented using YARD.
Gemfile gem 'mutagem', '~> 0.2.2'
install gem install mutagem