utils/package_hook_server.rb
# Does what it says on the tin. 
Does what it says on the tin.
Does what it says on the tin .
def handle_request
    payload = @req.POST["payload"]
    return rude_comment if payload.nil?
    @payload = JSON.parse(payload)
    @git = Git.open(@repository_path)
    @git.pull
    stats = @git.diff(@payload['before'], @payload['after']).stats
    parse_stats(stats).each { |name| package_plugin(name) }
    return nice_comment
  end
def handle_request payload = @req . POST [ "payload" ] return rude_comment if payload . nil? @payload = JSON . parse ( payload ) @git = Git . open ( @repository_path ) @git . pull stats = @git . diff ( @payload [ 'before' ] , @payload [ 'after' ] ) . stats parse_stats ( stats ) . each { | name | package_plugin ( name ) } return nice_comment end
Does what it says on the tin.
Does what it says on the tin .
# Send status 404 when no payload is supplied # Open git repository and pull updates # Get plugins and package them # Cool, there we go