pronto 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/pronto/github.rb +23 -13
- data/lib/pronto/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 745decf88e9fb240c3a33e5ac1d0969872f74ef4
|
4
|
+
data.tar.gz: 256b5eb2b0dcb08bf3322dd29f4499d8cdd47bef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0880f55cf76eb358fc5668ba9ef18ee1182d3d4d43ca5fce301c5862701a0524a95caedf2a90719f58bacd17ed23bbcddfd585d80200f5cb7543617281f94d8a
|
7
|
+
data.tar.gz: acbd3f8bedf6e2a5a830ba254307e59cab146993268d8e23375a6c6ee9a32386e9a77dd7ac23d9f61eecbe6b8a79d2141d808b557a24bd69da6573d6d7a7e939
|
data/CHANGELOG.md
CHANGED
data/lib/pronto/github.rb
CHANGED
@@ -31,7 +31,8 @@ module Pronto
|
|
31
31
|
|
32
32
|
def create_pull_comment(comment)
|
33
33
|
client.create_pull_comment(slug, pull_id, comment.body,
|
34
|
-
comment.sha,
|
34
|
+
pull_sha || comment.sha,
|
35
|
+
comment.path, comment.position)
|
35
36
|
end
|
36
37
|
|
37
38
|
private
|
@@ -54,20 +55,29 @@ module Pronto
|
|
54
55
|
auto_paginate: true)
|
55
56
|
end
|
56
57
|
|
57
|
-
def
|
58
|
-
|
58
|
+
def pull_id
|
59
|
+
pull ? pull[:number].to_i : env_pull_id.to_i
|
59
60
|
end
|
60
61
|
|
61
|
-
def
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
def env_pull_id
|
63
|
+
ENV['PULL_REQUEST_ID']
|
64
|
+
end
|
65
|
+
|
66
|
+
def pull_sha
|
67
|
+
pull[:head][:sha] if pull
|
68
|
+
end
|
69
|
+
|
70
|
+
def pull
|
71
|
+
return unless @repo.branch
|
72
|
+
@pull ||= if env_pull_id
|
73
|
+
pull_requests.find { |pr| pr[:number].to_i == env_pull_id.to_i }
|
74
|
+
else
|
75
|
+
pull_requests.find { |pr| pr[:head][:ref] == @repo.branch }
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def pull_requests
|
80
|
+
@pull_requests ||= client.pull_requests(slug)
|
71
81
|
end
|
72
82
|
|
73
83
|
Comment = Struct.new(:sha, :body, :path, :position) do
|
data/lib/pronto/version.rb
CHANGED