Skip to content

Instantly share code, notes, and snippets.

@failshell

failshell/api.rb Secret

Last active August 31, 2015 17:42
Show Gist options
  • Save failshell/71de09d6b7723acdb1c1 to your computer and use it in GitHub Desktop.
Save failshell/71de09d6b7723acdb1c1 to your computer and use it in GitHub Desktop.
require 'yaml'
require 'hipchat'
module Robut::API
def initialize
@config = YAML.load_file('hal9000.yml')
@token = @config['hipchat_token']
@room = @config['hipchat_room_id']
@client = HipChat::Client.new(@token, :api_version => 'v2')
end
def info(msg)
@client[@room].send('HAL 9000', msg, :color => 'green', :notify => true)
end
def warning(msg)
@client[@room].send('HAL 9000', msg, :color => 'yellow', :notify => true)
end
def error(msg)
@client[@room].send('HAL 9000', msg, :color => 'red', :notify => true)
end
end
class Robut::Plugin::WorkFlow
include Robut::API
include Robut::Plugin
desc 'Terraform workflow'
def usage
'migrate stack source destination'
end
def handle(time, sender_nick, message)
if message =~ /^migrate/
info('info')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment