adamwiggins (owner)

Forks

Revisions

gist: 48487 Download_button fork
public
Public Clone URL: git://gist.github.com/48487.git
Embed All Files: show embed
hoptoad_standalone.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'rubygems'
require 'rest_client'
require 'yaml'
 
params = {
        'api_key' => '...',
        'project' => 'myproj',
        'error_message' => "Testing sendalone notify",
        'backtrace' => "",
        'request' => {},
        'environment' => {}
}
 
headers = { :content_type => 'application/x-yaml' }
payload = YAML.dump('notice' => params)
 
begin
        RestClient.post('http://hoptoadapp.com/notices', payload, headers)
rescue => e
        puts e.response.body if e.respond_to? :response
        raise
end