The xm
gem will help you send xm(pp)
messages quickly for e.g. : logging, process notification, alerts ...
gem instal xm
Create the .xm
file in your ENV["HOME"]
: vim ~/.xm
.
Adapt-paste one of the following yaml templates.
- generic xmpp server
:login: x@xmpp.mydomain.com
:password: x
#uncomment :server: if using login_username@gmail.com
#:server: talk.google.com
:me: x@gmail.com
:us:
- x@gmail.com
- y@xmpp.mydomain.com
#"hostname" is passed to eval since it is in between backticks
:header: "[`hostname`] "
In any ruby script
require 'xm' #auth will fail here if wrong credentials in ~/.xm
xm "msg" #"msg" is sent to :me
xm_to "you@jabber.org" "msg"
xm_us "msg" #"msg" is sent to :us
if you like calling pp more (that's p + another p)
require 'xm'
pp "msg"
pp_to "you@jabber.org" "msg"
pp_us "msg"