How to attach files to ruby hipchat messages?

88 views Asked by At

I want to send text files through hipchat using the ruby hipchat-rb gem. There doesn't seem to be a way to do this described in the readme of this gem. Is it possible to do this?

1

There are 1 answers

0
Alex Cohen On BEST ANSWER

the working solution:

#!/usr/bin/env ruby
require 'hipchat'

client = HipChat::Client.new('HIPCHAT_TOKEN', :api_version => 'v2', :server_url => 'HIPCHAT_URL')
client.user('some_username').send_file('message', File.open('some-file.txt') )