github_api 0.17.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/github_api.rb +38 -76
- data/lib/github_api/api.rb +35 -18
- data/lib/github_api/api/arguments.rb +5 -0
- data/lib/github_api/api/config.rb +2 -4
- data/lib/github_api/api/config/property_set.rb +1 -0
- data/lib/github_api/authorization.rb +2 -0
- data/lib/github_api/client.rb +2 -0
- data/lib/github_api/client/activity.rb +2 -0
- data/lib/github_api/client/activity/events.rb +2 -0
- data/lib/github_api/client/activity/feeds.rb +2 -0
- data/lib/github_api/client/activity/notifications.rb +2 -0
- data/lib/github_api/client/activity/starring.rb +2 -0
- data/lib/github_api/client/activity/watching.rb +2 -0
- data/lib/github_api/client/authorizations.rb +2 -0
- data/lib/github_api/client/authorizations/app.rb +3 -1
- data/lib/github_api/client/emojis.rb +2 -0
- data/lib/github_api/client/gists.rb +2 -0
- data/lib/github_api/client/gists/comments.rb +2 -0
- data/lib/github_api/client/git_data.rb +2 -0
- data/lib/github_api/client/git_data/blobs.rb +2 -1
- data/lib/github_api/client/git_data/commits.rb +2 -0
- data/lib/github_api/client/git_data/references.rb +2 -0
- data/lib/github_api/client/git_data/tags.rb +2 -0
- data/lib/github_api/client/git_data/trees.rb +2 -0
- data/lib/github_api/client/gitignore.rb +2 -0
- data/lib/github_api/client/issues.rb +2 -0
- data/lib/github_api/client/issues/assignees.rb +35 -0
- data/lib/github_api/client/issues/comments.rb +2 -0
- data/lib/github_api/client/issues/events.rb +2 -0
- data/lib/github_api/client/issues/labels.rb +2 -0
- data/lib/github_api/client/issues/milestones.rb +2 -0
- data/lib/github_api/client/markdown.rb +3 -1
- data/lib/github_api/client/meta.rb +2 -0
- data/lib/github_api/client/orgs.rb +2 -0
- data/lib/github_api/client/orgs/hooks.rb +2 -0
- data/lib/github_api/client/orgs/members.rb +2 -0
- data/lib/github_api/client/orgs/memberships.rb +2 -0
- data/lib/github_api/client/orgs/projects.rb +2 -0
- data/lib/github_api/client/orgs/teams.rb +2 -0
- data/lib/github_api/client/projects.rb +2 -0
- data/lib/github_api/client/projects/cards.rb +3 -1
- data/lib/github_api/client/projects/columns.rb +2 -0
- data/lib/github_api/client/pull_requests.rb +2 -0
- data/lib/github_api/client/pull_requests/comments.rb +2 -0
- data/lib/github_api/client/pull_requests/reviews.rb +2 -0
- data/lib/github_api/client/repos.rb +17 -13
- data/lib/github_api/client/repos/branches.rb +48 -0
- data/lib/github_api/client/repos/branches/protections.rb +75 -0
- data/lib/github_api/client/repos/collaborators.rb +2 -1
- data/lib/github_api/client/repos/comments.rb +2 -0
- data/lib/github_api/client/repos/commits.rb +2 -0
- data/lib/github_api/client/repos/contents.rb +2 -0
- data/lib/github_api/client/repos/deployments.rb +2 -0
- data/lib/github_api/client/repos/downloads.rb +2 -0
- data/lib/github_api/client/repos/forks.rb +2 -0
- data/lib/github_api/client/repos/hooks.rb +2 -0
- data/lib/github_api/client/repos/keys.rb +2 -0
- data/lib/github_api/client/repos/merging.rb +2 -0
- data/lib/github_api/client/repos/pages.rb +2 -0
- data/lib/github_api/client/repos/projects.rb +4 -2
- data/lib/github_api/client/repos/pub_sub_hubbub.rb +2 -0
- data/lib/github_api/client/repos/releases.rb +2 -0
- data/lib/github_api/client/repos/releases/assets.rb +3 -1
- data/lib/github_api/client/repos/releases/tags.rb +2 -0
- data/lib/github_api/client/repos/statistics.rb +2 -0
- data/lib/github_api/client/repos/statuses.rb +2 -0
- data/lib/github_api/client/say.rb +2 -0
- data/lib/github_api/client/scopes.rb +2 -0
- data/lib/github_api/client/search.rb +3 -0
- data/lib/github_api/client/search/legacy.rb +2 -0
- data/lib/github_api/client/users.rb +2 -0
- data/lib/github_api/client/users/emails.rb +3 -0
- data/lib/github_api/client/users/followers.rb +2 -0
- data/lib/github_api/client/users/keys.rb +2 -0
- data/lib/github_api/configuration.rb +2 -1
- data/lib/github_api/connection.rb +4 -0
- data/lib/github_api/error.rb +1 -4
- data/lib/github_api/error/client_error.rb +2 -0
- data/lib/github_api/error/service_error.rb +2 -0
- data/lib/github_api/ext/faraday.rb +1 -1
- data/lib/github_api/middleware.rb +7 -7
- data/lib/github_api/page_iterator.rb +4 -1
- data/lib/github_api/page_links.rb +4 -0
- data/lib/github_api/paged_request.rb +2 -0
- data/lib/github_api/pagination.rb +4 -1
- data/lib/github_api/parameter_filter.rb +4 -1
- data/lib/github_api/params_hash.rb +3 -0
- data/lib/github_api/request.rb +5 -5
- data/lib/github_api/request/jsonize.rb +0 -1
- data/lib/github_api/request/oauth2.rb +2 -0
- data/lib/github_api/request/verbs.rb +3 -0
- data/lib/github_api/response/header.rb +2 -0
- data/lib/github_api/response/raise_error.rb +2 -1
- data/lib/github_api/response_wrapper.rb +5 -0
- data/lib/github_api/utils/url.rb +2 -0
- data/lib/github_api/validations.rb +5 -8
- data/lib/github_api/validations/format.rb +2 -0
- data/lib/github_api/validations/presence.rb +2 -0
- data/lib/github_api/validations/required.rb +2 -0
- data/lib/github_api/version.rb +1 -1
- metadata +9 -34
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative '../../api'
|
4
|
+
|
3
5
|
module Github
|
4
6
|
class Client::Repos::Projects < API
|
5
7
|
PREVIEW_MEDIA = "application/vnd.github.inertia-preview+json".freeze # :nodoc:
|
@@ -42,8 +44,8 @@ module Github
|
|
42
44
|
#
|
43
45
|
# @example
|
44
46
|
# github = Github.new
|
45
|
-
# github.repos.create 'owner-name', 'repo-name', name: 'project-name'
|
46
|
-
# github.repos.create name: 'project-name', body: 'project-body', owner: 'owner-name', repo: 'repo-name'
|
47
|
+
# github.repos.projects.create 'owner-name', 'repo-name', name: 'project-name'
|
48
|
+
# github.repos.projects.create name: 'project-name', body: 'project-body', owner: 'owner-name', repo: 'repo-name'
|
47
49
|
#
|
48
50
|
# @api public
|
49
51
|
def create(*args)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
require_relative '../../../api'
|
4
|
+
|
3
5
|
module Github
|
4
6
|
# The Release Assets API
|
5
7
|
class Client::Repos::Releases::Assets < API
|
@@ -35,7 +37,7 @@ module Github
|
|
35
37
|
#
|
36
38
|
# @api public
|
37
39
|
def get(*args)
|
38
|
-
|
40
|
+
arguments(args, required: [:owner, :repo, :id]).params
|
39
41
|
|
40
42
|
get_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/assets/#{arguments.id}" , arguments.params)
|
41
43
|
end
|
data/lib/github_api/error.rb
CHANGED
@@ -21,7 +21,7 @@ module Github
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def backtrace
|
24
|
-
if @response_message
|
24
|
+
if @response_message.respond_to?(:backtrace)
|
25
25
|
@response_message.backtrace
|
26
26
|
else
|
27
27
|
super
|
@@ -30,6 +30,3 @@ module Github
|
|
30
30
|
end # GithubError
|
31
31
|
end # Error
|
32
32
|
end # Github
|
33
|
-
|
34
|
-
require 'github_api/error/service_error'
|
35
|
-
require 'github_api/error/client_error'
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
require_relative 'response'
|
4
|
+
require_relative 'response/mashify'
|
5
|
+
require_relative 'response/jsonize'
|
6
|
+
require_relative 'response/atom_parser'
|
7
|
+
require_relative 'response/raise_error'
|
8
|
+
require_relative 'response/header'
|
9
|
+
require_relative 'response/follow_redirects'
|
10
10
|
|
11
11
|
module Github
|
12
12
|
class Middleware
|
@@ -1,8 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require 'github_api/utils/url'
|
4
3
|
require 'uri'
|
5
4
|
|
5
|
+
require_relative 'constants'
|
6
|
+
require_relative 'paged_request'
|
7
|
+
require_relative 'utils/url'
|
8
|
+
|
6
9
|
module Github
|
7
10
|
# A class responsible for requesting resources through page links
|
8
11
|
#
|
@@ -1,7 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
|
3
|
+
require_relative 'constants'
|
4
|
+
require_relative 'page_links'
|
5
|
+
require_relative 'page_iterator'
|
4
6
|
|
7
|
+
module Github
|
5
8
|
# A module that decorates response with pagination helpers
|
6
9
|
module Pagination
|
7
10
|
include Github::Constants
|
data/lib/github_api/request.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
require_relative 'connection'
|
4
|
+
require_relative 'response_wrapper'
|
5
|
+
require_relative 'request/oauth2'
|
6
|
+
require_relative 'request/basic_auth'
|
7
|
+
require_relative 'request/jsonize'
|
8
8
|
|
9
9
|
module Github
|
10
10
|
# A class responsible for dispatching http requests
|