Utility Belt
My Ruby Utilities
Install
gem install utilitybeltUsage
UtilityBelt.mkdir(*path)
Wrapper for
FileUtils.mkdir, which accepts path as argements to be joined andnoops if directory exists.
UtilityBelt.touch(*path)
Wrapper for
FileUtils.touch, which accepts path as argements to be joined and set's file perms to0644.
UtilityBelt.save(path, body, bin=false)
Save
bodyinpath, optionally as binary data viabin=true.
UtilityBelt.exec(*command)
Run command as joined argements. Returns a
Struct;#<struct stdout="STDOUT", stderr="STDERR", status=0>
UtilityBelt.encrypt!(source, destination, recipient)
GPG encrypts a
sourceto adestination. Returnsdestination
UtilityBelt.decrypt(source, recipient)
GPG decrypts a
source. Returns decrypted string.
UtilityBelt.decrypt!(source, destination, recipient)
GPG decrypts a
sourceto adestination. Returnsdestination.
UtilityBelt::NullLogger
A noop logger.
E.g.:
Something.new(:logger => UtilityBelt::NullLogger.new)
Stay tuned, more to come.
Development
Fork, clone and...
cd ruby-utilitybelt
bundle install --path .bundle
bundle exec rake test
# Or to test GPG stuff
# GPG_ID=<gpg email> bundle exec rake test