如何将文件附加到ruby hipchat消息? [英] How to attach files to ruby hipchat messages?

查看:117
本文介绍了如何将文件附加到ruby hipchat消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 ruby​​ hipchat-rb gem 通过hipchat发送文本文件。似乎没有办法在自己的自述文件中描述这一点。是否有可能这样做?

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?

推荐答案

工作解决方案:

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') )

这篇关于如何将文件附加到ruby hipchat消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆