ghub 2.0.0 → 2.2.0
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/ghub.gemspec +2 -1
- data/lib/ghub/api/page.rb +10 -6
- data/lib/ghub/container.rb +2 -0
- data/lib/ghub/endpoints/branches/protection/models/show.rb +1 -1
- data/lib/ghub/endpoints/pulls/models/show.rb +1 -1
- data/lib/ghub/models/application.rb +1 -1
- data/lib/ghub/models/branch.rb +1 -1
- data/lib/ghub/models/dismissal_restriction.rb +1 -1
- data/lib/ghub/models/links.rb +1 -1
- data/lib/ghub/models/repository.rb +1 -1
- data/lib/ghub/models/restriction.rb +1 -1
- data/lib/ghub/models/review.rb +1 -1
- data/lib/ghub/models/status_check.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +16 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5696032538ac72fddd970e849721e897c1e8ad5ffe5a7709c695cda3a1bdc8d5
|
|
4
|
+
data.tar.gz: 977c707839c5b937a465de02872e49d5643aed4d8f7b46b39d38ca18a996203c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7898aae0faebc26f84a172110d09daf868113f604eed4979ec6e2e09481daa966ac4b9e44ab868d5a6de6d19ba777aefc20487d841edb933745bfec51b4860e3
|
|
7
|
+
data.tar.gz: 0b28de3cd41723e520d433213937c7a54cb87ca3110748f5ae3a9d9ca8d1f7c7b14f5ae4584cebf1df2943f0d4cad2a904057342b6501c60a0e48c52dde944dd
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/ghub.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "ghub"
|
|
5
|
-
spec.version = "2.
|
|
5
|
+
spec.version = "2.2.0"
|
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
|
8
8
|
spec.homepage = "https://alchemists.io/projects/ghub"
|
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.add_dependency "inspectable", "~> 1.0"
|
|
33
33
|
spec.add_dependency "pipeable", "~> 2.0"
|
|
34
34
|
spec.add_dependency "refinements", "~> 14.0"
|
|
35
|
+
spec.add_dependency "rfc-web-link", "~> 0.1"
|
|
35
36
|
spec.add_dependency "zeitwerk", "~> 2.8"
|
|
36
37
|
|
|
37
38
|
spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
|
data/lib/ghub/api/page.rb
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
require "dry/monads"
|
|
4
4
|
require "json"
|
|
5
5
|
require "refinements/array"
|
|
6
|
+
require "rfc/web/link"
|
|
6
7
|
|
|
7
8
|
module Ghub
|
|
8
9
|
module API
|
|
9
10
|
# Represents a page of an API response.
|
|
10
11
|
class Page
|
|
12
|
+
include Dependencies[:configuration, :web_link]
|
|
11
13
|
extend Dry::Monads[:result]
|
|
12
14
|
|
|
13
15
|
using Refinements::Array
|
|
@@ -24,8 +26,9 @@ module Ghub
|
|
|
24
26
|
end
|
|
25
27
|
end
|
|
26
28
|
|
|
27
|
-
def initialize
|
|
29
|
+
def initialize(response, **)
|
|
28
30
|
@response = response
|
|
31
|
+
super(**)
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
def next = navigation __method__
|
|
@@ -48,12 +51,13 @@ module Ghub
|
|
|
48
51
|
|
|
49
52
|
attr_reader :response
|
|
50
53
|
|
|
51
|
-
def navigation
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
def navigation direction
|
|
55
|
+
link = web_link.call(response.headers).find do |link|
|
|
56
|
+
link.find_pair key: /rel/, value: direction.to_s
|
|
57
|
+
end
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
link ? link.uri[/page=(?<page>\d+)/, :page].to_i : 0
|
|
60
|
+
end
|
|
57
61
|
end
|
|
58
62
|
end
|
|
59
63
|
end
|
data/lib/ghub/container.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require "containable"
|
|
4
4
|
require "http"
|
|
5
|
+
require "rfc/web/link"
|
|
5
6
|
|
|
6
7
|
module Ghub
|
|
7
8
|
# Defines application dependencies.
|
|
@@ -11,5 +12,6 @@ module Ghub
|
|
|
11
12
|
register(:configuration) { Configuration::Loader.new.call }
|
|
12
13
|
register :http, HTTP
|
|
13
14
|
register(:api) { API::Client.new }
|
|
15
|
+
register(:web_link) { RFC::Web::Link.new self[:configuration].url }
|
|
14
16
|
end
|
|
15
17
|
end
|
data/lib/ghub/models/branch.rb
CHANGED
data/lib/ghub/models/links.rb
CHANGED
data/lib/ghub/models/review.rb
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ghub
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brooke Kuhlmann
|
|
@@ -147,6 +147,20 @@ dependencies:
|
|
|
147
147
|
- - "~>"
|
|
148
148
|
- !ruby/object:Gem::Version
|
|
149
149
|
version: '14.0'
|
|
150
|
+
- !ruby/object:Gem::Dependency
|
|
151
|
+
name: rfc-web-link
|
|
152
|
+
requirement: !ruby/object:Gem::Requirement
|
|
153
|
+
requirements:
|
|
154
|
+
- - "~>"
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: '0.1'
|
|
157
|
+
type: :runtime
|
|
158
|
+
prerelease: false
|
|
159
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
160
|
+
requirements:
|
|
161
|
+
- - "~>"
|
|
162
|
+
- !ruby/object:Gem::Version
|
|
163
|
+
version: '0.1'
|
|
150
164
|
- !ruby/object:Gem::Dependency
|
|
151
165
|
name: zeitwerk
|
|
152
166
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -291,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
291
305
|
- !ruby/object:Gem::Version
|
|
292
306
|
version: '0'
|
|
293
307
|
requirements: []
|
|
294
|
-
rubygems_version: 4.0.
|
|
308
|
+
rubygems_version: 4.0.19
|
|
295
309
|
specification_version: 4
|
|
296
310
|
summary: A monadic GitHub API client.
|
|
297
311
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|