-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsample.rb
36 lines (27 loc) · 1.01 KB
/
sample.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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