ghub 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +21 -13
- data/ghub.gemspec +1 -1
- data/lib/ghub/endpoints/pulls/models/show.rb +4 -2
- data/lib/ghub/endpoints/pulls/responses/show.rb +7 -7
- data/lib/ghub/endpoints/repositories/actions/create.rb +10 -10
- data/lib/ghub/endpoints/repositories/actions/patch.rb +10 -10
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: 86ed95e15942ee666a5e4094d1d5d7e77daed1886228491ba556cefa20cb9802
|
4
|
+
data.tar.gz: 555ba2c32b311df27c11965749a1caece8ef1e55561c72941524fdec862b4fef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 463c48c1e6a9407ab559bcc1a585affd67afc1f1f97d5db28c55e5cd56815ac6b8b402d14f0cd3b3c0424616ad4eb4cd5d7c085578c2e2a754dd99810f4cc14b
|
7
|
+
data.tar.gz: 36b9c113333d009fd8c71319bda53c1ba41bfb155f6d5f2bb6b7777b47de0c7a245ee69b6b219a904ff332bf1bb78c2fd55dc2ea878b3aca8ee32157dff975b0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -126,19 +126,27 @@ The following documents how to interact with repositories:
|
|
126
126
|
|
127
127
|
[source,ruby]
|
128
128
|
----
|
129
|
-
|
130
|
-
client.repositories.
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
client.repositories.
|
141
|
-
client.repositories.
|
129
|
+
# Index (user and organization)
|
130
|
+
# Format: client.repositories.index :<kind>, "<owner>"
|
131
|
+
client.repositories.index :users, "doe"
|
132
|
+
client.repositories.index :orgs, "acme"
|
133
|
+
|
134
|
+
# Show (user or organization)
|
135
|
+
# Format: client.repositories.show "<owner>", "<repository>"
|
136
|
+
client.repositories.show "acme", "ghub-test"
|
137
|
+
|
138
|
+
# Create (user and organization)
|
139
|
+
# Format: client.repositories.create :<kind>, <body>
|
140
|
+
client.repositories.create :users, {name: "ghub-test", private: true}
|
141
|
+
client.repositories.create :orgs, {name: "ghub-test", private: true}, owner: "acme"
|
142
|
+
|
143
|
+
# Patch (user or organization)
|
144
|
+
# Format: client.repositories.patch "<owner>", "<repository>", <body>
|
145
|
+
client.repositories.patch "acme", "ghub-test", {description: "For test only."}
|
146
|
+
|
147
|
+
# Destroy (user or organization)
|
148
|
+
# Format: client.repositories.destroy "<owner>", "<repository>"
|
149
|
+
client.repositories.destroy "acme", "ghub-test"
|
142
150
|
----
|
143
151
|
|
144
152
|
GitHub's API design for repositories is awkward and you can see this infect the Object API, especially when creating a repository. Use `:users` or `:orgs` (can be strings) to distinguish between the two types of repository creation. The only stipulation for organization creation is that you must supply the organization name. This was done so you could use the same Object API for both.
|
data/ghub.gemspec
CHANGED
@@ -32,7 +32,7 @@ module Ghub
|
|
32
32
|
:labels,
|
33
33
|
:locked,
|
34
34
|
:maintainer_can_modify,
|
35
|
-
:
|
35
|
+
:mergeable,
|
36
36
|
:merge_commit_sha,
|
37
37
|
:mergeable_state,
|
38
38
|
:merged,
|
@@ -59,9 +59,11 @@ module Ghub
|
|
59
59
|
include Resultable
|
60
60
|
|
61
61
|
def self.for attributes
|
62
|
+
assignee = attributes[:assignee]
|
63
|
+
|
62
64
|
new attributes.merge(
|
63
65
|
_links: Ghub::Models::Links.for(attributes[:_links]),
|
64
|
-
assignee: Ghub::Models::User[
|
66
|
+
assignee: (Ghub::Models::User[assignee] if assignee),
|
65
67
|
assignees: attributes[:assignees].map { |data| Ghub::Models::User[data] },
|
66
68
|
base: Ghub::Models::Branch[attributes[:base]],
|
67
69
|
head: Ghub::Models::Branch[attributes[:head]],
|
@@ -6,13 +6,13 @@ module Ghub
|
|
6
6
|
module Responses
|
7
7
|
# Defines a single pull request.
|
8
8
|
Show = Dry::Schema.Params do
|
9
|
-
required(:_links).hash
|
9
|
+
required(:_links).hash Ghub::Responses::Links
|
10
10
|
required(:active_lock_reason).maybe :string
|
11
|
-
required(:assignee).hash
|
12
|
-
required(:assignees).array
|
11
|
+
required(:assignee).maybe :hash, Ghub::Responses::User
|
12
|
+
required(:assignees).array Ghub::Responses::User
|
13
13
|
required(:author_association).filled :string
|
14
14
|
required(:auto_merge).maybe :bool
|
15
|
-
required(:base).hash
|
15
|
+
required(:base).hash Ghub::Responses::Branch
|
16
16
|
required(:body).filled :string
|
17
17
|
required(:closed_at).filled :string
|
18
18
|
required(:comments_url).filled :string
|
@@ -20,11 +20,11 @@ module Ghub
|
|
20
20
|
required(:created_at).filled :string
|
21
21
|
required(:diff_url).filled :string
|
22
22
|
required(:draft).filled :bool
|
23
|
-
required(:head).hash
|
23
|
+
required(:head).hash Ghub::Responses::Branch
|
24
24
|
required(:html_url).filled :string
|
25
25
|
required(:id).filled :integer
|
26
26
|
required(:issue_url).filled :string
|
27
|
-
required(:labels).array
|
27
|
+
required(:labels).array Ghub::Responses::Label
|
28
28
|
required(:locked).filled :bool
|
29
29
|
required(:merge_commit_sha).filled :string
|
30
30
|
required(:merged_at).maybe :date_time
|
@@ -41,7 +41,7 @@ module Ghub
|
|
41
41
|
required(:title).filled :string
|
42
42
|
required(:updated_at).filled :string
|
43
43
|
required(:url).filled :string
|
44
|
-
required(:user).hash
|
44
|
+
required(:user).hash Ghub::Responses::User
|
45
45
|
|
46
46
|
optional(:additions).filled :integer
|
47
47
|
optional(:changed_files).filled :integer
|
@@ -19,16 +19,16 @@ module Ghub
|
|
19
19
|
include Transactable
|
20
20
|
|
21
21
|
def call kind, body, owner: nil, **parameters
|
22
|
-
path.create(kind, owner:)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
path.create(kind, owner:).bind do |url_path|
|
23
|
+
pipe body,
|
24
|
+
validate(request),
|
25
|
+
insert(url_path, at: 0),
|
26
|
+
insert(parameters),
|
27
|
+
to(client, :post),
|
28
|
+
try(:parse, catch: JSON::ParserError),
|
29
|
+
validate(response),
|
30
|
+
to(model, :for)
|
31
|
+
end
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -19,16 +19,16 @@ module Ghub
|
|
19
19
|
include Transactable
|
20
20
|
|
21
21
|
def call owner, id, body, **parameters
|
22
|
-
path.patch(owner, id)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
path.patch(owner, id).bind do |url_path|
|
23
|
+
pipe body,
|
24
|
+
validate(request),
|
25
|
+
insert(url_path, at: 0),
|
26
|
+
insert(parameters),
|
27
|
+
to(client, :patch),
|
28
|
+
try(:parse, catch: JSON::ParserError),
|
29
|
+
validate(response),
|
30
|
+
to(model, :for)
|
31
|
+
end
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
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: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
|
29
29
|
RFE=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
31
|
+
date: 2023-01-08 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: dry-container
|
@@ -269,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
269
|
- !ruby/object:Gem::Version
|
270
270
|
version: '0'
|
271
271
|
requirements: []
|
272
|
-
rubygems_version: 3.4.
|
272
|
+
rubygems_version: 3.4.2
|
273
273
|
signing_key:
|
274
274
|
specification_version: 4
|
275
275
|
summary: A monadic GitHub API client.
|
metadata.gz.sig
CHANGED
Binary file
|