Skip to content

Commit

Permalink
Merge pull request octokit#336 from danmcclain/master
Browse files Browse the repository at this point in the history
Add support for the /hooks endpoint
  • Loading branch information
pengwynn committed Nov 13, 2013
2 parents 7f6a5d4 + b26387d commit 4d3ac13
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/octokit/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
require 'octokit/client/events'
require 'octokit/client/gists'
require 'octokit/client/gitignore'
require 'octokit/client/hooks'
require 'octokit/client/issues'
require 'octokit/client/labels'
require 'octokit/client/legacy_search'
Expand Down Expand Up @@ -55,6 +56,7 @@ class Client
include Octokit::Client::Events
include Octokit::Client::Gists
include Octokit::Client::Gitignore
include Octokit::Client::Hooks
include Octokit::Client::Issues
include Octokit::Client::Labels
include Octokit::Client::LegacySearch
Expand Down
2 changes: 1 addition & 1 deletion lib/octokit/client/emojis.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Octokit
class Client

# Methods for the the unpublished Emojis API
# Methods for the Emojis API
module Emojis

# List all emojis used on GitHub
Expand Down
17 changes: 17 additions & 0 deletions lib/octokit/client/hooks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Octokit
class Client

# Methods for the Hooks API
module Hooks

# List all Service Hooks supported by GitHub
#
# @return [Sawyer::Resource] A list of all hooks on GitHub
# @example List all hooks
# Octokit.available_hooks
def available_hooks(options = {})
get "hooks", options
end
end
end
end

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions spec/octokit/client/hooks_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'helper'

describe Octokit::Client::Hooks do

describe ".available_hooks", :vcr do
it "returns all the hooks supported by GitHub with their parameters" do
client = oauth_client
hooks = client.available_hooks
expect(hooks.first.name).to eq "activecollab"
end
end
end

0 comments on commit 4d3ac13

Please sign in to comment.