hub_link 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9919e3d917fadaa8bf596d6b215e3585ba0e58ef
4
- data.tar.gz: 3e566b33f29e2db85da70f4ebd2dface2a8cb123
3
+ metadata.gz: d19f7bf5e1a7a9b210f5bdba1602b4a1347ebfae
4
+ data.tar.gz: 2812a6707c069e10209960bf692a88c0d8bae43c
5
5
  SHA512:
6
- metadata.gz: 0c1773b7f54b6c3f9a20e9010f759da5fe7c8718a0078d612d6f2fb4905d5bea2e3738f358b287ed3ad665cb921bf946fde260508332e33dfd15f51fd051567b
7
- data.tar.gz: 60b18d0891462a141d52ebf98cbb5f6a7a93ea020f5222f9b329969c26af1b59f87f9aa76b23ae31902fcd84a7910a5874affe8f749a76c4cf807665f08ac6b7
6
+ metadata.gz: 4ec6e0c6f7b9b0894aba97cc5f868d9652fc55e0b2d4513a810d78e7596a595e1f8180c7ecd83f1daa3263ff3752ffeac803404d0a513ad417da666c719fdf15
7
+ data.tar.gz: f8096c9fac8c9b9b8df2285d6cb5ed9ef0cd5ad659adea63577d170431154e44d99e3a64d72850d0aed12c043936141d97bf44e92d31e360e6389370ba0368a6
@@ -83,7 +83,7 @@ module HubLink
83
83
  requests = Octokit.pull_request_review_requests(repo, number)
84
84
 
85
85
  requests.users.compact.map do |reviewer|
86
- ReviewRequest.new(id: id, created_at: created_at, reviewer: reviewer.login, requester: submitter, pull_request_id: id)
86
+ ReviewRequest.new(created_at: created_at, reviewer: reviewer.login, requester: submitter, pull_request_id: id)
87
87
  end
88
88
  end
89
89
 
@@ -1,19 +1,31 @@
1
1
  module HubLink
2
2
  module Api
3
3
  class ReviewRequest
4
- attr_reader :id, :reviewer, :requester, :created_at, :pull_request_id
4
+ require "digest/sha1"
5
5
 
6
- def initialize(id:, reviewer:, requester:, created_at:, pull_request_id:)
7
- @id = id
6
+ attr_reader :reviewer, :requester, :created_at, :pull_request_id
7
+
8
+ def initialize(reviewer:, requester:, created_at:, pull_request_id:)
8
9
  @reviewer = reviewer
9
10
  @requester = requester
10
11
  @created_at = created_at
11
12
  @pull_request_id = pull_request_id
12
13
  end
13
14
 
15
+ # API doesn't return IDs for review requests https://developer.github.com/v3/pulls/review_requests/#list-review-requests
16
+ def digest
17
+ Digest::SHA1.hexdigest(digest_components.join)
18
+ end
19
+
14
20
  def to_h
15
- Slicer.new(self, columns: %i(id reviewer requester created_at pull_request_id)).to_h
21
+ Slicer.new(self, columns: %i(digest reviewer requester created_at pull_request_id)).to_h
16
22
  end
23
+
24
+ private
25
+
26
+ def digest_components
27
+ [pull_request_id, reviewer]
28
+ end
17
29
  end
18
30
  end
19
31
  end
@@ -1,3 +1,3 @@
1
1
  module HubLink
2
- VERSION = "0.9.1"
2
+ VERSION = "0.10.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-25 00:00:00.000000000 Z
11
+ date: 2019-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport