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
16 17 18 19 20 21 |
# File 'lib/octokit/client/pub_sub_hubbub/service_hooks.rb', line 16 def subscribe_service_hook(repo, service_name, service_arguments = {}) topic = "https://github.com/#{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
32 33 34 35 36 37 |
# File 'lib/octokit/client/pub_sub_hubbub/service_hooks.rb', line 32 def unsubscribe_service_hook(repo, service_name) topic = "https://github.com/#{Repository.new(repo)}/events/push" callback = "github://#{service_name}" unsubscribe(topic, callback) true end |