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

Version Path
houston-core-0.7.0.beta3 app/controllers/project_hooks_controller.rb
houston-core-0.7.0.beta2 app/controllers/project_hooks_controller.rb
houston-core-0.7.0.beta app/controllers/project_hooks_controller.rb
houston-core-0.6.3 app/controllers/project_hooks_controller.rb
houston-core-0.6.2 app/controllers/project_hooks_controller.rb
houston-core-0.6.1 app/controllers/project_hooks_controller.rb
houston-core-0.6.0 app/controllers/project_hooks_controller.rb
houston-core-0.5.6 app/controllers/project_hooks_controller.rb
houston-core-0.5.5 app/controllers/project_hooks_controller.rb
houston-core-0.5.4 app/controllers/project_hooks_controller.rb
houston-core-0.5.3 app/controllers/project_hooks_controller.rb
houston-core-0.5.2 app/controllers/project_hooks_controller.rb
houston-core-0.5.1 app/controllers/project_hooks_controller.rb
houston-core-0.5.0 app/controllers/project_hooks_controller.rb