Sha256: 8d3b1aadbf33d977badf97af4ef1e75a8242d127d320596bd82413480e1f7fd8
Contents?: true
Size: 739 Bytes
Versions: 14
Compression:
Stored size: 739 Bytes
Contents
class ProjectHooksController < ApplicationController skip_before_filter :verify_authenticity_token def trigger project = Project.find_by_slug(params[:project_id]) unless project render text: "A project with the slug '#{params[:project_id]}' could not be found", status: 404 return end event = "hooks:#{params[:hook]}" unless Houston.observer.observed?(event) render text: "A hook with the slug '#{params[:hook]}' is not defined", status: 404 return end payload = params.except(:action, :controller).merge({ sender: { ip: request.remote_ip, agent: request.user_agent } }) Houston.observer.fire event, project, payload head 200 end end
Version data entries
14 entries across 14 versions & 1 rubygems