support/ruby/collins-notify/lib/collins_notify/adapter/hipchat.rb
# Bindings available
#   room_name - hipchat room
#   username - user message being sent as
#   at - If we are at'ing a person
Bindings available
room_name - hipchat room
username - user message being sent as
at - If we are at'ing a person
Bindings available room_name - hipchat room username - user message being sent as at - If we are at ' ing a person
def notify! message_obj = OpenStruct.new, to = nil
      room_name = get_room message_obj
      username = get_from_username message_obj
      if room_name.nil? then
        raise CollinsNotify::CollinsNotifyException.new "No obj.room or hipchat.room specified"
      end
      message = get_message_body(binding).strip.gsub(/[\n\r]/, ' ')
      message = "@#{to} #{message}" unless to.nil?
      logger.info "Notifying #{room_name} from #{username} with message #{message}"
      if config.test? then
        logger.info "Not sending hipchat message in test mode"
        return true
      end
      opts = client_options(message_obj)
      logger.debug "Using hipchat options #{opts.inspect}"
      client[room_name].send(username, message, client_options(message_obj))
    end
def notify! message_obj = OpenStruct . new , to = nil room_name = get_room message_obj username = get_from_username message_obj if room_name . nil? then raise CollinsNotify :: CollinsNotifyException . new "No obj.room or hipchat.room specified" end message = get_message_body ( binding ) . strip . gsub ( / [ \n \r ] / , ' ' ) message = "@#{to} #{message}" unless to . nil? logger . info "Notifying #{room_name} from #{username} with message #{message}" if config . test? then logger . info "Not sending hipchat message in test mode" return true end opts = client_options ( message_obj ) logger . debug "Using hipchat options #{opts.inspect}" client [ room_name ] . send ( username , message , client_options ( message_obj ) ) end
Bindings available
room_name - hipchat room
username - user message being sent as
at - If we are at'ing a person
Bindings available room_name - hipchat room username - user message being sent as at - If we are at ' ing a person
message_obj
new
to