class Github::Client::Repos::PubSubHubbub
Constants
- OPTIONS
Public Instance Methods
subscribe(*args)
click to toggle source
Subscribe to existing topic/event through pubsubhubbub
@param [Hash] params @input params [String] :topic
Required string. The URI of the GitHub repository to subscribe to. The path must be in the format of /:user/:repo/events/:event.
@input params [String] :callback
Required string - The URI to receive the updates to the topic.
@example
github = Github.new oauth_token: 'token' github.repos.pubsubhubbub.subscribe 'https://github.com/:user/:repo/events/push', 'github://Email?address=peter-murach@gmail.com', verify: 'sync', secret: '...'
@api public
# File lib/github_api/client/repos/pub_sub_hubbub.rb, line 28 def subscribe(*args) params = arguments(args, required: [:topic, :callback]).params _merge_action!("subscribe", arguments.topic, arguments.callback, params) params['options'] = OPTIONS post_request("/hub", params) end
subscribe_service(*args)
click to toggle source
Subscribe repository to service hook through pubsubhubbub
@param [Hash] params @input params [String] :event
Required hash key for the type of event. The default event is push.
@example
github = Github.new oauth_token: '...' github.repos.pubsubhubbub.subscribe_service 'user-name', 'repo-name', 'campfire', subdomain: 'github', room: 'Commits', token: 'abc123', event: 'watch'
@api public
# File lib/github_api/client/repos/pub_sub_hubbub.rb, line 79 def subscribe_service(*args) params = arguments(args, required: [:user, :repo, :service]).params event = params.delete('event') || 'push' topic = "#{site}/#{arguments.user}/#{arguments.repo}/events/#{event}" callback = "github://#{arguments.service}?#{params.serialize}" subscribe(topic, callback) end
Also aliased as: subscribe_repository, subscribe_repo
unsubscribe(*args)
click to toggle source
Unsubscribe from existing topic/event through pubsubhubbub
@param [Hash] params @input params [String] :topic
Required string. The URI of the GitHub repository to unsubscribe from. The path must be in the format of /:user/:repo/events/:event.
@input params [String] :callback
Required string. The URI to unsubscribe the topic from.
@example
github = Github.new oauth_token: 'token' github.repos.pubsubhubbub.unsubscribe 'https://github.com/:user/:repo/events/push', 'github://Email?address=peter-murach@gmail.com', verify: 'sync', secret: '...'
@api public
# File lib/github_api/client/repos/pub_sub_hubbub.rb, line 55 def unsubscribe(*args) params = arguments(args, required: [:topic, :callback]).params _merge_action!("unsubscribe", arguments.topic, arguments.callback, params) params['options'] = OPTIONS post_request("/hub", params) end
unsubscribe_service(*args)
click to toggle source
Subscribe repository to service hook through pubsubhubbub
@param [Hash] params @input params [String] :event
Optional hash key for the type of event. The default event is push.
@example
github = Github.new oauth_token: '...' github.repos.pubsubhubbub.unsubscribe_service 'user-name', 'repo-name', 'campfire'
@example
github.repos.pubsubhubbub.unsubscribe_service user: 'user-name', repo: 'repo-name', service: 'service-name'
@api public
# File lib/github_api/client/repos/pub_sub_hubbub.rb, line 108 def unsubscribe_service(*args) params = arguments(args, required: [:user, :repo, :service]).params event = params.delete('event') || 'push' topic = "#{site}/#{arguments.user}/#{arguments.repo}/events/#{event}" callback = "github://#{arguments.service}" unsubscribe(topic, callback) end
Also aliased as: unsubscribe_repository, unsubscribe_repo