Parent

Object

Public Instance Methods

deploy_user() click to toggle source
# File lib/hipchat/capistrano.rb, line 111
def deploy_user
  fetch(:hipchat_deploy_user, "Deploy")
end
deployment_name() click to toggle source
# File lib/hipchat/capistrano.rb, line 81
def deployment_name
  if fetch(:branch, nil)
    name = "#{application}/#{branch}"
    name += " (revision #{real_revision[0..7]})" if real_revision
    name
  else
    application
  end
end
env() click to toggle source
# File lib/hipchat/capistrano.rb, line 127
def env
  fetch(:hipchat_env, fetch(:rack_env, fetch(:rails_env, "production")))
end
failed_message_color() click to toggle source
# File lib/hipchat/capistrano.rb, line 99
def failed_message_color
  fetch(:hipchat_failed_color, "red")
end
human() click to toggle source
# File lib/hipchat/capistrano.rb, line 115
def human
  ENV['HIPCHAT_USER'] ||
    fetch(:hipchat_human,
          if (u = %{git config user.name}.strip) != ""
            u
          elsif (u = ENV['USER']) != ""
            u
          else
            "Someone"
          end)
end
message_color() click to toggle source
# File lib/hipchat/capistrano.rb, line 91
def message_color
  fetch(:hipchat_color, nil)
end
message_format() click to toggle source
# File lib/hipchat/capistrano.rb, line 107
def message_format
  fetch(:hipchat_message_format, "html")
end
message_notification() click to toggle source
# File lib/hipchat/capistrano.rb, line 103
def message_notification
  fetch(:hipchat_announce, false)
end
send(message, options) click to toggle source
# File lib/hipchat/capistrano.rb, line 54
def send(message, options)
  set :hipchat_client, HipChat::Client.new(hipchat_token) if fetch(:hipchat_client, nil).nil?

  if hipchat_room_name.is_a?(String)
    rooms = [hipchat_room_name]
  elsif hipchat_room_name.is_a?(Symbol)
    rooms = [hipchat_room_name.to_s]
  else
    rooms = hipchat_room_name
  end

  rooms.each { |room|
    begin
      hipchat_client[room].send(deploy_user, message, options)
    rescue UnknownRoom => e
      puts e.message
      puts e.backtrace
    rescue Unauthorized => e
      puts e.message
      puts e.backtrace
    rescue UnknownResponseCode => e
      puts e.message
      puts e.backtrace
    end
  }
end
send_options() click to toggle source
# File lib/hipchat/capistrano.rb, line 46
def send_options
  return @send_options if defined?(@send_options)
  @send_options = message_format ? {:message_format => message_format } : {}
  @send_options.merge!(:notify => message_notification)
  @send_options.merge!(:color => message_color)
  @send_options
end
success_message_color() click to toggle source
# File lib/hipchat/capistrano.rb, line 95
def success_message_color
  fetch(:hipchat_success_color, "green")
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.