Module: Github
- Defined in:
- lib/github_api2/error/client_error.rb,
lib/github_api2.rb,
lib/github_api2/api.rb,
lib/github_api2/mash.rb,
lib/github_api2/error.rb,
lib/github_api2/client.rb,
lib/github_api2/request.rb,
lib/github_api2/version.rb,
lib/github_api2/response.rb,
lib/github_api2/constants.rb,
lib/github_api2/mime_type.rb,
lib/github_api2/utils/url.rb,
lib/github_api2/api/config.rb,
lib/github_api2/client/say.rb,
lib/github_api2/connection.rb,
lib/github_api2/middleware.rb,
lib/github_api2/normalizer.rb,
lib/github_api2/page_links.rb,
lib/github_api2/pagination.rb,
lib/github_api2/rate_limit.rb,
lib/github_api2/api/actions.rb,
lib/github_api2/api/factory.rb,
lib/github_api2/client/meta.rb,
lib/github_api2/client/orgs.rb,
lib/github_api2/deprecation.rb,
lib/github_api2/params_hash.rb,
lib/github_api2/validations.rb,
lib/github_api2/client/gists.rb,
lib/github_api2/client/repos.rb,
lib/github_api2/client/users.rb,
lib/github_api2/null_encoder.rb,
lib/github_api2/api/arguments.rb,
lib/github_api2/authorization.rb,
lib/github_api2/client/emojis.rb,
lib/github_api2/client/issues.rb,
lib/github_api2/client/scopes.rb,
lib/github_api2/client/search.rb,
lib/github_api2/configuration.rb,
lib/github_api2/page_iterator.rb,
lib/github_api2/paged_request.rb,
lib/github_api2/request/verbs.rb,
lib/github_api2/request/oauth2.rb,
lib/github_api2/client/activity.rb,
lib/github_api2/client/git_data.rb,
lib/github_api2/client/markdown.rb,
lib/github_api2/client/projects.rb,
lib/github_api2/request/jsonize.rb,
lib/github_api2/response/header.rb,
lib/github_api2/response/xmlize.rb,
lib/github_api2/client/gitignore.rb,
lib/github_api2/parameter_filter.rb,
lib/github_api2/response/jsonize.rb,
lib/github_api2/response/mashify.rb,
lib/github_api2/response_wrapper.rb,
lib/github_api2/client/orgs/hooks.rb,
lib/github_api2/client/orgs/teams.rb,
lib/github_api2/client/repos/keys.rb,
lib/github_api2/client/users/keys.rb,
lib/github_api2/validations/token.rb,
lib/github_api2/client/repos/forks.rb,
lib/github_api2/client/repos/hooks.rb,
lib/github_api2/client/repos/pages.rb,
lib/github_api2/request/basic_auth.rb,
lib/github_api2/validations/format.rb,
lib/github_api2/api/config/property.rb,
lib/github_api2/client/orgs/members.rb,
lib/github_api2/client/users/emails.rb,
lib/github_api2/error/service_error.rb,
lib/github_api2/client/git_data/tags.rb,
lib/github_api2/client/issues/events.rb,
lib/github_api2/client/issues/labels.rb,
lib/github_api2/client/orgs/projects.rb,
lib/github_api2/client/pull_requests.rb,
lib/github_api2/client/repos/commits.rb,
lib/github_api2/client/repos/merging.rb,
lib/github_api2/client/search/legacy.rb,
lib/github_api2/response/atom_parser.rb,
lib/github_api2/response/raise_error.rb,
lib/github_api2/validations/presence.rb,
lib/github_api2/validations/required.rb,
lib/github_api2/client/activity/feeds.rb,
lib/github_api2/client/authorizations.rb,
lib/github_api2/client/gists/comments.rb,
lib/github_api2/client/git_data/blobs.rb,
lib/github_api2/client/git_data/trees.rb,
lib/github_api2/client/projects/cards.rb,
lib/github_api2/client/repos/branches.rb,
lib/github_api2/client/repos/comments.rb,
lib/github_api2/client/repos/contents.rb,
lib/github_api2/client/repos/projects.rb,
lib/github_api2/client/repos/releases.rb,
lib/github_api2/client/repos/statuses.rb,
lib/github_api2/client/activity/events.rb,
lib/github_api2/client/issues/comments.rb,
lib/github_api2/client/repos/downloads.rb,
lib/github_api2/client/users/followers.rb,
lib/github_api2/api/config/property_set.rb,
lib/github_api2/client/git_data/commits.rb,
lib/github_api2/client/issues/assignees.rb,
lib/github_api2/client/orgs/memberships.rb,
lib/github_api2/client/projects/columns.rb,
lib/github_api2/client/repos/statistics.rb,
lib/github_api2/client/activity/starring.rb,
lib/github_api2/client/activity/watching.rb,
lib/github_api2/client/issues/milestones.rb,
lib/github_api2/client/repos/deployments.rb,
lib/github_api2/client/repos/invitations.rb,
lib/github_api2/client/authorizations/app.rb,
lib/github_api2/response/follow_redirects.rb,
lib/github_api2/client/git_data/references.rb,
lib/github_api2/client/repos/collaborators.rb,
lib/github_api2/client/repos/releases/tags.rb,
lib/github_api2/client/repos/pub_sub_hubbub.rb,
lib/github_api2/client/pull_requests/reviews.rb,
lib/github_api2/client/repos/releases/assets.rb,
lib/github_api2/client/activity/notifications.rb,
lib/github_api2/client/pull_requests/comments.rb,
lib/github_api2/client/repos/branches/protections.rb
Overview
First saw on octokit, then copied from lostisland/faraday_middleware and adapted for this library.
faraday_middleware/lib/faraday_middleware/response/follow_redirects.rb
Defined Under Namespace
Modules: Authorization, Connection, Constants, Error, MimeType, Normalizer, NullParamsEncoder, PagedRequest, Pagination, ParameterFilter, RateLimit, Utils, Validations Classes: API, Client, Configuration, Mash, Middleware, PageIterator, PageLinks, ParamsHash, RedirectLimitReached, Request, Response, ResponseWrapper
Constant Summary collapse
- LIBNAME =
'github_api2'
- LIBDIR =
File.("../#{LIBNAME}", __FILE__)
- VERSION =
"1.0.1"
- DEPRECATION_PREFIX =
"[GithubAPI] Deprecation warning:"
Class Attribute Summary collapse
Class Method Summary collapse
-
.configuration ⇒ Configuration
(also: config)
The client configuration.
-
.configure {|configuration| ... } ⇒ nil
Configure options.
-
.default_middleware(options = {}) ⇒ Proc
private
Default middleware stack that uses default adapter as specified by configuration setup.
-
.deprecate(method, alternate_method = nil) ⇒ Object
Displays deprecation message to the user.
-
.method_missing(method_name, *args, &block) ⇒ Object
private
Delegate to Github::Client.
-
.new(options = {}, &block) ⇒ Github::Client
Alias for Github::Client.new.
- .respond_to?(method_name, include_private = false) ⇒ Boolean
- .warn_deprecation(message) ⇒ Object
Class Attribute Details
.deprecation_tracker ⇒ Object
11 12 13 |
# File 'lib/github_api2/deprecation.rb', line 11 def deprecation_tracker @deprecation_tracker ||= [] end |
Class Method Details
.configuration ⇒ Configuration Also known as: config
The client configuration
19 20 21 |
# File 'lib/github_api2.rb', line 19 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ nil
Configure options
38 39 40 |
# File 'lib/github_api2.rb', line 38 def configure yield configuration end |
.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
60 61 62 |
# File 'lib/github_api2.rb', line 60 def default_middleware( = {}) Middleware.default() 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_api2/deprecation.rb', line 17 def deprecate(method, alternate_method=nil) return if deprecation_tracker.include? method deprecation_tracker << method = <<-NOTICE #{DEPRECATION_PREFIX} * #{method} is deprecated. NOTICE if alternate_method << <<-ADDITIONAL * please use #{alternate_method} instead. ADDITIONAL end warn_deprecation() 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
67 68 69 70 71 72 73 74 75 |
# File 'lib/github_api2.rb', line 67 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
50 51 52 |
# File 'lib/github_api2.rb', line 50 def new( = {}, &block) Client.new(, &block) end |
.respond_to?(method_name, include_private = false) ⇒ Boolean
77 78 79 80 81 |
# File 'lib/github_api2.rb', line 77 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_api2/deprecation.rb', line 34 def warn_deprecation() send :warn, end |