module Jabber

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

XMPP4R - XMPP Library for Ruby

License

Ruby's license (see the LICENSE file) or GNU GPL, at your option.

Website::http://home.gna.org/xmpp4r/

The Jabber module is the root namespace of the library.

Constants

XMPP4R_VERSION

XMPP4R Version number. This is the ONLY place where the version number should be specified. This constant is used to determine the version of package tarballs and generated gems.

warnings

if debug is enabled, we should automatically enable warnings too

Public Class Methods

debug() click to toggle source

returns true if debugging mode is enabled. If you just want to log something if debugging is enabled, use ::debuglog instead.

# File lib/xmpp4r/debuglog.rb, line 45
def Jabber::debug
  @@debug
end
debug=(debug) click to toggle source

Enable/disable debugging mode. When debug mode is enabled, information can be logged using ::debuglog. When debug mode is disabled, calls to ::debuglog are just ignored.

# File lib/xmpp4r/debuglog.rb, line 26
def Jabber::debug=(debug)
  @@debug = debug
  if @@debug
    debuglog('Debugging mode enabled.')
    #if debug is enabled, we should automatically enable warnings too
    Jabber::warnings = true
  end
end
debuglog(string) click to toggle source

Outputs a string only if debugging mode is enabled. If the string includes several lines, 4 spaces are added at the beginning of each line but the first one. Time is prepended to the string.

# File lib/xmpp4r/debuglog.rb, line 52
def Jabber::debuglog(string)
  return if not @@debug
  logger.debug string.chomp.gsub("\n", "\n    ")
end
logger() click to toggle source
# File lib/xmpp4r/debuglog.rb, line 8
def Jabber::logger
  @@logger ||= Logger.new($stderr)
end
logger=(logger) click to toggle source

Set the logger to use for debug and warn (if enabled)

# File lib/xmpp4r/debuglog.rb, line 13
def Jabber::logger=(logger)
  @@logger = logger
end
warnings=(warnings) click to toggle source

Enable/disable warnings mode.

# File lib/xmpp4r/debuglog.rb, line 36
def Jabber::warnings=(warnings)
  @@warnings = warnings
  if @@warnings
    warnlog('Warnings mode enabled.')
  end
end
warnlog(string) click to toggle source

Outputs a string only if warnings mode is enabled.

# File lib/xmpp4r/debuglog.rb, line 58
def Jabber::warnlog(string)
  return if not @@warnings
  logger.warn string.chomp.gsub("\n", "\n    ")
end