github_api 0.17.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/lib/github_api.rb +38 -76
  3. data/lib/github_api/api.rb +35 -18
  4. data/lib/github_api/api/arguments.rb +5 -0
  5. data/lib/github_api/api/config.rb +2 -4
  6. data/lib/github_api/api/config/property_set.rb +1 -0
  7. data/lib/github_api/authorization.rb +2 -0
  8. data/lib/github_api/client.rb +2 -0
  9. data/lib/github_api/client/activity.rb +2 -0
  10. data/lib/github_api/client/activity/events.rb +2 -0
  11. data/lib/github_api/client/activity/feeds.rb +2 -0
  12. data/lib/github_api/client/activity/notifications.rb +2 -0
  13. data/lib/github_api/client/activity/starring.rb +2 -0
  14. data/lib/github_api/client/activity/watching.rb +2 -0
  15. data/lib/github_api/client/authorizations.rb +2 -0
  16. data/lib/github_api/client/authorizations/app.rb +3 -1
  17. data/lib/github_api/client/emojis.rb +2 -0
  18. data/lib/github_api/client/gists.rb +2 -0
  19. data/lib/github_api/client/gists/comments.rb +2 -0
  20. data/lib/github_api/client/git_data.rb +2 -0
  21. data/lib/github_api/client/git_data/blobs.rb +2 -1
  22. data/lib/github_api/client/git_data/commits.rb +2 -0
  23. data/lib/github_api/client/git_data/references.rb +2 -0
  24. data/lib/github_api/client/git_data/tags.rb +2 -0
  25. data/lib/github_api/client/git_data/trees.rb +2 -0
  26. data/lib/github_api/client/gitignore.rb +2 -0
  27. data/lib/github_api/client/issues.rb +2 -0
  28. data/lib/github_api/client/issues/assignees.rb +35 -0
  29. data/lib/github_api/client/issues/comments.rb +2 -0
  30. data/lib/github_api/client/issues/events.rb +2 -0
  31. data/lib/github_api/client/issues/labels.rb +2 -0
  32. data/lib/github_api/client/issues/milestones.rb +2 -0
  33. data/lib/github_api/client/markdown.rb +3 -1
  34. data/lib/github_api/client/meta.rb +2 -0
  35. data/lib/github_api/client/orgs.rb +2 -0
  36. data/lib/github_api/client/orgs/hooks.rb +2 -0
  37. data/lib/github_api/client/orgs/members.rb +2 -0
  38. data/lib/github_api/client/orgs/memberships.rb +2 -0
  39. data/lib/github_api/client/orgs/projects.rb +2 -0
  40. data/lib/github_api/client/orgs/teams.rb +2 -0
  41. data/lib/github_api/client/projects.rb +2 -0
  42. data/lib/github_api/client/projects/cards.rb +3 -1
  43. data/lib/github_api/client/projects/columns.rb +2 -0
  44. data/lib/github_api/client/pull_requests.rb +2 -0
  45. data/lib/github_api/client/pull_requests/comments.rb +2 -0
  46. data/lib/github_api/client/pull_requests/reviews.rb +2 -0
  47. data/lib/github_api/client/repos.rb +17 -13
  48. data/lib/github_api/client/repos/branches.rb +48 -0
  49. data/lib/github_api/client/repos/branches/protections.rb +75 -0
  50. data/lib/github_api/client/repos/collaborators.rb +2 -1
  51. data/lib/github_api/client/repos/comments.rb +2 -0
  52. data/lib/github_api/client/repos/commits.rb +2 -0
  53. data/lib/github_api/client/repos/contents.rb +2 -0
  54. data/lib/github_api/client/repos/deployments.rb +2 -0
  55. data/lib/github_api/client/repos/downloads.rb +2 -0
  56. data/lib/github_api/client/repos/forks.rb +2 -0
  57. data/lib/github_api/client/repos/hooks.rb +2 -0
  58. data/lib/github_api/client/repos/keys.rb +2 -0
  59. data/lib/github_api/client/repos/merging.rb +2 -0
  60. data/lib/github_api/client/repos/pages.rb +2 -0
  61. data/lib/github_api/client/repos/projects.rb +4 -2
  62. data/lib/github_api/client/repos/pub_sub_hubbub.rb +2 -0
  63. data/lib/github_api/client/repos/releases.rb +2 -0
  64. data/lib/github_api/client/repos/releases/assets.rb +3 -1
  65. data/lib/github_api/client/repos/releases/tags.rb +2 -0
  66. data/lib/github_api/client/repos/statistics.rb +2 -0
  67. data/lib/github_api/client/repos/statuses.rb +2 -0
  68. data/lib/github_api/client/say.rb +2 -0
  69. data/lib/github_api/client/scopes.rb +2 -0
  70. data/lib/github_api/client/search.rb +3 -0
  71. data/lib/github_api/client/search/legacy.rb +2 -0
  72. data/lib/github_api/client/users.rb +2 -0
  73. data/lib/github_api/client/users/emails.rb +3 -0
  74. data/lib/github_api/client/users/followers.rb +2 -0
  75. data/lib/github_api/client/users/keys.rb +2 -0
  76. data/lib/github_api/configuration.rb +2 -1
  77. data/lib/github_api/connection.rb +4 -0
  78. data/lib/github_api/error.rb +1 -4
  79. data/lib/github_api/error/client_error.rb +2 -0
  80. data/lib/github_api/error/service_error.rb +2 -0
  81. data/lib/github_api/ext/faraday.rb +1 -1
  82. data/lib/github_api/middleware.rb +7 -7
  83. data/lib/github_api/page_iterator.rb +4 -1
  84. data/lib/github_api/page_links.rb +4 -0
  85. data/lib/github_api/paged_request.rb +2 -0
  86. data/lib/github_api/pagination.rb +4 -1
  87. data/lib/github_api/parameter_filter.rb +4 -1
  88. data/lib/github_api/params_hash.rb +3 -0
  89. data/lib/github_api/request.rb +5 -5
  90. data/lib/github_api/request/jsonize.rb +0 -1
  91. data/lib/github_api/request/oauth2.rb +2 -0
  92. data/lib/github_api/request/verbs.rb +3 -0
  93. data/lib/github_api/response/header.rb +2 -0
  94. data/lib/github_api/response/raise_error.rb +2 -1
  95. data/lib/github_api/response_wrapper.rb +5 -0
  96. data/lib/github_api/utils/url.rb +2 -0
  97. data/lib/github_api/validations.rb +5 -8
  98. data/lib/github_api/validations/format.rb +2 -0
  99. data/lib/github_api/validations/presence.rb +2 -0
  100. data/lib/github_api/validations/required.rb +2 -0
  101. data/lib/github_api/version.rb +1 -1
  102. metadata +9 -34
@@ -1,7 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'faraday'
4
- require 'github_api/error'
4
+
5
+ require_relative '../error/service_error'
5
6
 
6
7
  module Github
7
8
  class Response::RaiseError < Faraday::Response::Middleware
@@ -1,5 +1,9 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require 'forwardable'
4
+
5
+ require_relative 'pagination'
6
+
3
7
  module Github
4
8
  # A class responsible for proxing to faraday response
5
9
  class ResponseWrapper
@@ -19,6 +23,7 @@ module Github
19
23
  @response = response
20
24
  @current_api = current_api
21
25
  @env = response.env
26
+ @body = nil
22
27
  end
23
28
 
24
29
  # Overwrite methods to hash keys
@@ -1,3 +1,5 @@
1
+ # encoding:utf-8
2
+
1
3
  require 'cgi'
2
4
  require 'addressable/uri'
3
5
 
@@ -1,14 +1,12 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require_relative 'validations/format'
4
+ require_relative 'validations/presence'
5
+ require_relative 'validations/required'
6
+ require_relative 'validations/token'
7
+
3
8
  module Github
4
9
  module Validations
5
-
6
- Github::require_all 'github_api/validations',
7
- 'presence',
8
- 'token',
9
- 'format',
10
- 'required'
11
-
12
10
  include Presence
13
11
  include Format
14
12
  include Token
@@ -20,6 +18,5 @@ module Github
20
18
  'auto_pagination',
21
19
  'jsonp_callback'
22
20
  ]
23
-
24
21
  end # Validation
25
22
  end # Github
@@ -1,5 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require_relative '../error/client_error'
4
+
3
5
  module Github
4
6
  module Validations
5
7
  module Format
@@ -1,5 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require_relative '../error/client_error'
4
+
3
5
  module Github
4
6
  module Validations
5
7
  # A mixin to help validate presence of non-empty values
@@ -1,5 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require_relative '../error/client_error'
4
+
3
5
  module Github
4
6
  module Validations
5
7
  module Required
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Github
4
- VERSION = "0.17.0"
4
+ VERSION = "0.18.1"
5
5
  end # Github
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-18 00:00:00.000000000 Z
11
+ date: 2017-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.4.0
19
+ version: '2.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.4.0
26
+ version: '2.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hashie
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -45,9 +45,6 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.8'
48
- - - "<"
49
- - !ruby/object:Gem::Version
50
- version: '0.10'
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
@@ -55,9 +52,6 @@ dependencies:
55
52
  - - "~>"
56
53
  - !ruby/object:Gem::Version
57
54
  version: '0.8'
58
- - - "<"
59
- - !ruby/object:Gem::Version
60
- version: '0.10'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: oauth2
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,26 +80,6 @@ dependencies:
86
80
  - - "~>"
87
81
  - !ruby/object:Gem::Version
88
82
  version: 0.0.4
89
- - !ruby/object:Gem::Dependency
90
- name: mime-types
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: '1.16'
96
- - - "<"
97
- - !ruby/object:Gem::Version
98
- version: '3.0'
99
- type: :runtime
100
- prerelease: false
101
- version_requirements: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: '1.16'
106
- - - "<"
107
- - !ruby/object:Gem::Version
108
- version: '3.0'
109
83
  - !ruby/object:Gem::Dependency
110
84
  name: bundler
111
85
  requirement: !ruby/object:Gem::Requirement
@@ -188,14 +162,14 @@ dependencies:
188
162
  requirements:
189
163
  - - "~>"
190
164
  - !ruby/object:Gem::Version
191
- version: 2.3.2
165
+ version: 3.0.1
192
166
  type: :development
193
167
  prerelease: false
194
168
  version_requirements: !ruby/object:Gem::Requirement
195
169
  requirements:
196
170
  - - "~>"
197
171
  - !ruby/object:Gem::Version
198
- version: 2.3.2
172
+ version: 3.0.1
199
173
  description: " Ruby client that supports all of the GitHub API methods. It's build
200
174
  in a modular way, that is, you can either instantiate the whole api wrapper Github.new
201
175
  or use parts of it e.i. Github::Client::Repos.new if working solely with repositories
@@ -258,6 +232,8 @@ files:
258
232
  - lib/github_api/client/pull_requests/comments.rb
259
233
  - lib/github_api/client/pull_requests/reviews.rb
260
234
  - lib/github_api/client/repos.rb
235
+ - lib/github_api/client/repos/branches.rb
236
+ - lib/github_api/client/repos/branches/protections.rb
261
237
  - lib/github_api/client/repos/collaborators.rb
262
238
  - lib/github_api/client/repos/comments.rb
263
239
  - lib/github_api/client/repos/commits.rb
@@ -343,7 +319,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
343
319
  requirements:
344
320
  - - ">="
345
321
  - !ruby/object:Gem::Version
346
- version: 1.9.2
322
+ version: 2.0.0
347
323
  required_rubygems_version: !ruby/object:Gem::Requirement
348
324
  requirements:
349
325
  - - ">="
@@ -356,4 +332,3 @@ signing_key:
356
332
  specification_version: 4
357
333
  summary: Ruby client for the official GitHub API
358
334
  test_files: []
359
- has_rdoc: