Module: Github

Extended by:
ClassMethods
Defined in:
lib/github_api/error/client_error.rb,
lib/github_api.rb,
lib/github_api/api.rb,
lib/github_api/error.rb,
lib/github_api/client.rb,
lib/github_api/version.rb,
lib/github_api/request.rb,
lib/github_api/response.rb,
lib/github_api/constants.rb,
lib/github_api/utils/url.rb,
lib/github_api/mime_type.rb,
lib/github_api/rate_limit.rb,
lib/github_api/middleware.rb,
lib/github_api/pagination.rb,
lib/github_api/connection.rb,
lib/github_api/page_links.rb,
lib/github_api/client/say.rb,
lib/github_api/api/config.rb,
lib/github_api/normalizer.rb,
lib/github_api/validations.rb,
lib/github_api/client/meta.rb,
lib/github_api/client/orgs.rb,
lib/github_api/params_hash.rb,
lib/github_api/api/actions.rb,
lib/github_api/api/factory.rb,
lib/github_api/deprecation.rb,
lib/github_api/null_encoder.rb,
lib/github_api/client/gists.rb,
lib/github_api/client/repos.rb,
lib/github_api/client/users.rb,
lib/github_api/request/verbs.rb,
lib/github_api/page_iterator.rb,
lib/github_api/client/emojis.rb,
lib/github_api/client/scopes.rb,
lib/github_api/client/issues.rb,
lib/github_api/client/search.rb,
lib/github_api/paged_request.rb,
lib/github_api/api/arguments.rb,
lib/github_api/configuration.rb,
lib/github_api/authorization.rb,
lib/github_api/request/oauth2.rb,
lib/github_api/request/jsonize.rb,
lib/github_api/response/header.rb,
lib/github_api/response/xmlize.rb,
lib/github_api/client/git_data.rb,
lib/github_api/client/activity.rb,
lib/github_api/client/markdown.rb,
lib/github_api/response_wrapper.rb,
lib/github_api/response/jsonize.rb,
lib/github_api/response/mashify.rb,
lib/github_api/client/gitignore.rb,
lib/github_api/parameter_filter.rb,
lib/github_api/client/users/keys.rb,
lib/github_api/client/repos/keys.rb,
lib/github_api/client/orgs/teams.rb,
lib/github_api/client/orgs/hooks.rb,
lib/github_api/validations/token.rb,
lib/github_api/request/basic_auth.rb,
lib/github_api/client/repos/pages.rb,
lib/github_api/client/repos/forks.rb,
lib/github_api/client/repos/hooks.rb,
lib/github_api/validations/format.rb,
lib/github_api/error/service_error.rb,
lib/github_api/client/users/emails.rb,
lib/github_api/client/orgs/members.rb,
lib/github_api/api/config/property.rb,
lib/github_api/response/raise_error.rb,
lib/github_api/response/atom_parser.rb,
lib/github_api/client/pull_requests.rb,
lib/github_api/client/search/legacy.rb,
lib/github_api/client/repos/commits.rb,
lib/github_api/client/repos/merging.rb,
lib/github_api/client/issues/events.rb,
lib/github_api/client/issues/labels.rb,
lib/github_api/client/git_data/tags.rb,
lib/github_api/validations/presence.rb,
lib/github_api/validations/required.rb,
lib/github_api/client/gists/comments.rb,
lib/github_api/client/activity/feeds.rb,
lib/github_api/client/authorizations.rb,
lib/github_api/client/repos/comments.rb,
lib/github_api/client/repos/releases.rb,
lib/github_api/client/repos/contents.rb,
lib/github_api/client/repos/statuses.rb,
lib/github_api/client/git_data/trees.rb,
lib/github_api/client/git_data/blobs.rb,
lib/github_api/core_ext/ordered_hash.rb,
lib/github_api/client/users/followers.rb,
lib/github_api/client/activity/events.rb,
lib/github_api/client/repos/downloads.rb,
lib/github_api/client/issues/comments.rb,
lib/github_api/client/repos/statistics.rb,
lib/github_api/client/orgs/memberships.rb,
lib/github_api/client/issues/assignees.rb,
lib/github_api/client/git_data/commits.rb,
lib/github_api/api/config/property_set.rb,
lib/github_api/client/activity/watching.rb,
lib/github_api/client/activity/starring.rb,
lib/github_api/client/repos/deployments.rb,
lib/github_api/client/issues/milestones.rb,
lib/github_api/client/authorizations/app.rb,
lib/github_api/client/repos/collaborators.rb,
lib/github_api/client/repos/releases/tags.rb,
lib/github_api/client/git_data/references.rb,
lib/github_api/client/repos/pub_sub_hubbub.rb,
lib/github_api/client/repos/releases/assets.rb,
lib/github_api/client/pull_requests/comments.rb,
lib/github_api/client/activity/notifications.rb

Overview

:nodoc

Defined Under Namespace

Modules: Authorization, ClassMethods, Connection, Constants, CoreExt, Error, MimeType, Normalizer, NullParamsEncoder, PagedRequest, Pagination, ParameterFilter, RateLimit, Utils, Validations Classes: API, Client, Configuration, Middleware, PageIterator, PageLinks, ParamsHash, Request, Response, ResponseWrapper

Constant Summary collapse

LIBNAME =
'github_api'
LIBDIR =
File.expand_path("../#{LIBNAME}", __FILE__)
VERSION =
"0.14.4"
DEPRECATION_PREFIX =
"[GithubAPI] Deprecation warning:"

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from ClassMethods

configuration, configure, require_all

Class Attribute Details

.deprecation_trackerObject


11
12
13
# File 'lib/github_api/deprecation.rb', line 11

def deprecation_tracker
  @deprecation_tracker ||= []
end

Class Method Details

.default_middleware(options = {}) ⇒ Proc

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Default middleware stack that uses default adapter as specified by configuration setup

Returns:

  • (Proc)

43
44
45
# File 'lib/github_api.rb', line 43

def default_middleware(options = {})
  Middleware.default(options)
end

.deprecate(method, alternate_method = nil) ⇒ Object

Displays deprecation message to the user. Each message is printed once.


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/github_api/deprecation.rb', line 17

def deprecate(method, alternate_method=nil)
  return if deprecation_tracker.include? method
  deprecation_tracker << method

  message = <<-NOTICE
#{DEPRECATION_PREFIX}

* #{method} is deprecated.
NOTICE
  if alternate_method
    message << <<-ADDITIONAL
* please use #{alternate_method} instead.
ADDITIONAL
  end
  warn_deprecation(message)
end

.included(base) ⇒ Object


21
22
23
# File 'lib/github_api.rb', line 21

def included(base)
  base.extend ClassMethods
end

.method_missing(method_name, *args, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Delegate to Github::Client


50
51
52
53
54
55
56
57
58
# File 'lib/github_api.rb', line 50

def method_missing(method_name, *args, &block)
  if new.respond_to?(method_name)
    new.send(method_name, *args, &block)
  elsif configuration.respond_to?(method_name)
    Github.configuration.send(method_name, *args, &block)
  else
    super
  end
end

.new(options = {}, &block) ⇒ Github::Client

Alias for Github::Client.new

Parameters:

  • options (Hash) (defaults to: {})

    the configuration options

Returns:


33
34
35
# File 'lib/github_api.rb', line 33

def new(options = {}, &block)
  Client.new(options, &block)
end

.respond_to?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)

60
61
62
63
64
# File 'lib/github_api.rb', line 60

def respond_to?(method_name, include_private = false)
  new.respond_to?(method_name, include_private) ||
  configuration.respond_to?(method_name) ||
  super(method_name, include_private)
end

.warn_deprecation(message) ⇒ Object


34
35
36
# File 'lib/github_api/deprecation.rb', line 34

def warn_deprecation(message)
  send :warn, message
end