A set of convenience utils for Ruby. An inspired, close-to-feature-parity port of python-htk-lite
.
- Debug via Slack using
::Htk::Utils.slack_debug('some debugging message')
. The best ofprintln
debugging, without the inconvenience of visually fishing for one message out of thousands of log lines. - Debug via writing to local file using
fdebug
(::Htk::Utils.fdebug('some debugging message')
) andfdebug_json
(::Htk::Utils.fdebug_json(some_object)
). Certifiably awesome, fast, and secure.
- Install via Ruby Gems:
gem install htk
- (Alternative install via clone) Install via local clone: Clone this repository into a directory named
htk
(preferred) orhtk_lite
SSH:git clone [email protected]:hacktoolkit/htk-rb.git htk
HTTPS:git clone https://github.com/hacktoolkit/htk-rb.git
- (Optional) Create a symlink to
htk
inside of your app'slib/
directory. - Create
local_settings.rb
and add your Slack incoming webhook URL toSLACK_WEBHOOK_URL
.
- You can place it outside of your app directory tree, and then symlink it inside.
- To not be nagged by the presence of the
htk
directory whenever you dogit status
, addhtk
to your.git/info/exclude
file (like.gitignore
, but only in your local repository, not checked in).
- In your code, simply do:
::Htk::Utils.slack_debug('This is seriously awesome!') ::Htk::Utils.slack_debug('Yeah, no kidding.')
- Check your Slack to verify that the message was posted. If not, perhaps your token was wrong, or the Slack integration was disabled.
(Alternative link to screenshot above: https://cl.ly/436cfb4383a2) - Profit!
- (Recommended) Create a BASH alias or similar:
alias fdb='touch /tmp/fdebug.log; tail -f /tmp/fdebug.log'
- In a separate window used for debugging, run
fdb
to watch the logs roll in.
- In a separate window used for debugging, run
::Htk::Utils.fdebug('Not all heroes wear capes')
- C# - https://github.com/hacktoolkit/csharp-htk
- JavaScript - https://github.com/hacktoolkit/htk.js
- PHP - https://github.com/hacktoolkit/php-htk
- Python (full) - https://github.com/hacktoolkit/python-htk
- Python (lite) - https://github.com/hacktoolkit/python-htk-lite
- Ruby - https://github.com/hacktoolkit/htk-rb
MIT. See LICENSE.md