forked from piotrmurach/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub_api.rb
More file actions
97 lines (85 loc) · 1.92 KB
/
Copy pathgithub_api.rb
File metadata and controls
97 lines (85 loc) · 1.92 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# encoding: utf-8
require 'github_api/version'
require 'github_api/configuration'
require 'github_api/constants'
require 'github_api/utils/url'
require 'github_api/connection'
require 'github_api/deprecation'
require 'github_api/core_ext/ordered_hash'
require 'github_api/ext/faraday'
module Github
extend Configuration
LIBNAME = 'github_api'
LIBDIR = File.expand_path("../#{LIBNAME}", __FILE__)
class << self
def included(base)
base.extend ClassMethods
end
# Alias for Github::Client.new
#
# @return [Github::Client]
def new(options = {}, &block)
Github::Client.new(options, &block)
end
# Delegate to Github::Client
#
def method_missing(method, *args, &block)
return super unless new.respond_to?(method)
new.send(method, *args, &block)
end
def respond_to?(method, include_private = false)
new.respond_to?(method, include_private) || super(method, include_private)
end
end
module ClassMethods
# Requires internal github_api libraries
#
# @param [String] prefix
# the relative path prefix
# @param [Array[String]] libs
# the array of libraries to require
#
# @return [self]
def require_all(prefix, *libs)
libs.each do |lib|
require "#{File.join(prefix, lib)}"
end
end
end
extend ClassMethods
require_all LIBDIR,
'authorization',
'validations',
'normalizer',
'parameter_filter',
'api',
'arguments',
'activity',
'api_factory',
'client',
'repos',
'pagination',
'request',
'response',
'response_wrapper',
'error',
'issues',
'gists',
'git_data',
'gitignore',
'orgs',
'pull_requests',
'users',
'emojis',
'search',
'say',
'scopes',
'markdown',
'meta',
'mime_type',
'authorizations',
'page_links',
'paged_request',
'page_iterator',
'params_hash'
end # Github