Module: Octokit::Client::PubSubHubbub::ServiceHooks
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/pub_sub_hubbub/service_hooks.rb
Instance Method Summary collapse
-
#subscribe_service_hook(repo, service_name, service_arguments = {}) ⇒ Object
Subscribe to a repository through pubsub.
-
#unsubscribe_service_hook(repo, service_name) ⇒ Object
Unsubscribe repository through pubsub.
Instance Method Details
#subscribe_service_hook(repo, service_name, service_arguments = {}) ⇒ Object
Subscribe to a repository through pubsub
15 16 17 18 19 20 |
# File 'lib/octokit/client/pub_sub_hubbub/service_hooks.rb', line 15 def subscribe_service_hook(repo, service_name, service_arguments = {}) topic = "#{Octokit.web_endpoint}#{Repository.new(repo)}/events/push" callback = "github://#{service_name}?#{service_arguments.collect{ |k,v| [ k,v ].join("=") }.join("&") }" subscribe(topic, callback) true end |
#unsubscribe_service_hook(repo, service_name) ⇒ Object
Unsubscribe repository through pubsub
30 31 32 33 34 35 |
# File 'lib/octokit/client/pub_sub_hubbub/service_hooks.rb', line 30 def unsubscribe_service_hook(repo, service_name) topic = "#{Octokit.web_endpoint}#{Repository.new(repo)}/events/push" callback = "github://#{service_name}" unsubscribe(topic, callback) true end |