Skip to content

Instantly share code, notes, and snippets.

@tobeportable
Last active December 15, 2015 20:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobeportable/5321083 to your computer and use it in GitHub Desktop.
Save tobeportable/5321083 to your computer and use it in GitHub Desktop.
xm gem documentation

XM

The xm gem will help you send xm(pp) messages quickly for e.g. : logging, process notification, alerts ...

installation

gem instal xm

configuration

Create the .xm file in your ENV["HOME"] : vim ~/.xm.

Adapt-paste one of the following yaml templates.

  1. 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`] "

usage

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"                         
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment