-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Darshan Shankar
committed
Sep 14, 2014
1 parent
4cde175
commit 0541a10
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require 'octokit/client' | ||
require 'octokit/default' | ||
|
||
# Ruby toolkit for the GitHub API | ||
# an rb testfile shamelessly copied | ||
# from https://github.com/octokit/octokit.rb/blob/master/lib/octokit.rb | ||
|
||
module Octokit | ||
|
||
class << self | ||
include Octokit::Configurable | ||
|
||
# API client based on configured options {Configurable} | ||
# | ||
# @return [Octokit::Client] API wrapper | ||
def client | ||
@client = Octokit::Client.new(options) unless defined?(@client) && @client.same_options?(options) | ||
@client | ||
end | ||
|
||
# @private | ||
def respond_to_missing?(method_name, include_private=false); client.respond_to?(method_name, include_private); end if RUBY_VERSION >= "1.9" | ||
# @private | ||
def respond_to?(method_name, include_private=false); client.respond_to?(method_name, include_private) || super; end if RUBY_VERSION < "1.9" | ||
|
||
private | ||
|
||
def method_missing(method_name, *args, &block) | ||
return super unless client.respond_to?(method_name) | ||
client.send(method_name, *args, &block) | ||
end | ||
|
||
end | ||
end | ||
|
||
Octokit.setup |