Module: GithubWebhook::Processor

Extended by:
ActiveSupport::Concern
Defined in:
lib/github_webhook/processor.rb

Defined Under Namespace

Classes: SignatureError, UnspecifiedWebhookSecretError, UnsupportedContentTypeError, UnsupportedGithubEventError

Constant Summary collapse

GITHUB_EVENTS_WHITELIST =
%w(ping commit_comment create delete deployment deployment_status download follow fork fork_apply gist gollum issue_comment issues member membership page_build public pull_request pull_request_review_comment push release repository status team_add watch)

Instance Method Summary collapse

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
# File 'lib/github_webhook/processor.rb', line 16

def create
  if self.respond_to? event_method
    self.send event_method, json_body
    head(:ok)
  else
    raise NoMethodError.new("GithubWebhooksController##{event_method} not implemented")
  end
end

#github_ping(payload) ⇒ Object



25
26
27
# File 'lib/github_webhook/processor.rb', line 25

def github_ping(payload)
  puts "[GithubWebhook::Processor] Hook ping received, hook_id: #{payload[:hook_id]}, #{payload[:zen]}"
end