xambassador
GitHub webhook written in Ruby
Usage
Xambassador is intended to be used with Sinatra.
-
First install Xambassador with
gem install xambassador
-
Create a new Sinatra webapp and in your
server.rb
file add the following code:
require 'sinatra'
require 'json'
require 'xambassador/pull_request'
post '/event_handler' do
case request.env['HTTP_X_GITHUB_EVENT']
when 'pull_request'
payload = JSON.parse(request.body.read)
Xambassador::PullRequest.new(payload)
end
end