danger-github_ext 0.0.3 → 0.0.4
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
- data/Gemfile.lock +9 -9
- data/README.md +7 -5
- data/lib/github_ext/gem_version.rb +1 -1
- data/lib/github_ext/plugin.rb +22 -17
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32c5a228d02f374b206abc21f0bc04ac8e5c461a
|
4
|
+
data.tar.gz: 92c9780ca3b04525fc5ef7d65126faf0530036fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6bd4cd8fb83d961b878d792dd424d04e10030cbdad7d00d005290f15d5155fff99ade0dd1e7017acc87f3525c162e4be36d531713195bf5ab06b6e44e8237d6
|
7
|
+
data.tar.gz: ff05e40242406af1b46646f1256ca125cbddd311e89c7cf7eff87a3e8542762698ac515ab2ee4c9777d3d8aff2c13550c1b0e1cb95bf8c05f36c90fe935bd973
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-github_ext (0.0.
|
4
|
+
danger-github_ext (0.0.4)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
addressable (2.5.1)
|
11
11
|
public_suffix (~> 2.0, >= 2.0.2)
|
12
12
|
ast (2.3.0)
|
13
|
-
claide (1.0.
|
13
|
+
claide (1.0.2)
|
14
14
|
claide-plugins (0.9.2)
|
15
15
|
cork
|
16
16
|
nap
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
colored2 (3.1.2)
|
20
20
|
cork (0.3.0)
|
21
21
|
colored2 (~> 3.1)
|
22
|
-
danger (
|
22
|
+
danger (5.3.4)
|
23
23
|
claide (~> 1.0)
|
24
24
|
claide-plugins (>= 0.9.2)
|
25
25
|
colored2 (~> 3.1)
|
@@ -28,12 +28,12 @@ GEM
|
|
28
28
|
faraday-http-cache (~> 1.0)
|
29
29
|
git (~> 1)
|
30
30
|
kramdown (~> 1.5)
|
31
|
-
octokit (~> 4.
|
31
|
+
octokit (~> 4.7)
|
32
32
|
terminal-table (~> 1)
|
33
33
|
danger-plugin-api (1.0.0)
|
34
34
|
danger (> 2.0)
|
35
35
|
diff-lcs (1.3)
|
36
|
-
faraday (0.12.
|
36
|
+
faraday (0.12.2)
|
37
37
|
multipart-post (>= 1.2, < 3)
|
38
38
|
faraday-http-cache (1.3.1)
|
39
39
|
faraday (~> 0.8)
|
@@ -55,7 +55,7 @@ GEM
|
|
55
55
|
guard (~> 2.1)
|
56
56
|
guard-compat (~> 1.1)
|
57
57
|
rspec (>= 2.99.0, < 4.0)
|
58
|
-
kramdown (1.
|
58
|
+
kramdown (1.14.0)
|
59
59
|
listen (3.0.7)
|
60
60
|
rb-fsevent (>= 0.9.3)
|
61
61
|
rb-inotify (>= 0.9.7)
|
@@ -108,8 +108,8 @@ GEM
|
|
108
108
|
faraday (~> 0.8, < 1.0)
|
109
109
|
shellany (0.0.1)
|
110
110
|
slop (3.6.0)
|
111
|
-
terminal-table (1.
|
112
|
-
unicode-display_width (~> 1.1.1)
|
111
|
+
terminal-table (1.8.0)
|
112
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
113
113
|
thor (0.19.4)
|
114
114
|
unicode-display_width (1.1.3)
|
115
115
|
yard (0.9.8)
|
@@ -131,4 +131,4 @@ DEPENDENCIES
|
|
131
131
|
yard (~> 0.8)
|
132
132
|
|
133
133
|
BUNDLED WITH
|
134
|
-
1.14.
|
134
|
+
1.14.5
|
data/README.md
CHANGED
@@ -56,15 +56,17 @@ github.open</pre>
|
|
56
56
|
|
57
57
|
#### Methods
|
58
58
|
|
59
|
-
`mergeable?` -
|
59
|
+
`mergeable?` - Determine if pull request is mergeable and mergeable status is clean
|
60
60
|
|
61
|
-
`labels` -
|
61
|
+
`labels` - List labels for the pull request
|
62
62
|
|
63
|
-
`add_labels` -
|
63
|
+
`add_labels` - Add labels to the pull request
|
64
64
|
|
65
|
-
`
|
65
|
+
`add_label` - Add label with color to the pull request
|
66
66
|
|
67
|
-
`
|
67
|
+
`remove_labels` - Remove labels from the pull request
|
68
|
+
|
69
|
+
`statuses` - List current statuses for the head commit
|
68
70
|
|
69
71
|
`update_pr_title` - Update the title of the pull request
|
70
72
|
|
data/lib/github_ext/plugin.rb
CHANGED
@@ -49,15 +49,16 @@ module Danger
|
|
49
49
|
self.api.auto_paginate = true
|
50
50
|
end
|
51
51
|
|
52
|
-
#
|
52
|
+
# Determine if pull request is mergeable and mergeable status is clean
|
53
53
|
# @return [boolean]
|
54
54
|
#
|
55
55
|
def mergeable?
|
56
56
|
self.pr_json.attrs[:mergeable_state] == 'clean' && github.pr_json.attrs[:mergeable]
|
57
57
|
end
|
58
58
|
|
59
|
-
#
|
59
|
+
# List labels for the pull request
|
60
60
|
# @return [[String]]
|
61
|
+
# @deprecated Please use {#pr_labels} instead
|
61
62
|
#
|
62
63
|
def labels
|
63
64
|
@repo ||= self.pr_json.base.repo.full_name
|
@@ -67,7 +68,7 @@ module Danger
|
|
67
68
|
}
|
68
69
|
end
|
69
70
|
|
70
|
-
#
|
71
|
+
# Add labels to the pull request
|
71
72
|
# @param [[String]] labels
|
72
73
|
# @return [void]
|
73
74
|
#
|
@@ -77,7 +78,20 @@ module Danger
|
|
77
78
|
self.api.add_labels_to_an_issue(@repo, @number, Array(labels))
|
78
79
|
end
|
79
80
|
|
80
|
-
#
|
81
|
+
# Add label with color to the pull request
|
82
|
+
# @param [String] label
|
83
|
+
# @param [String] color
|
84
|
+
# @return [void]
|
85
|
+
#
|
86
|
+
def add_label(label, color = 'ffffff')
|
87
|
+
@repo ||= self.pr_json.base.repo.full_name
|
88
|
+
@number ||= self.pr_json.number
|
89
|
+
self.api.update_label(@repo, label, {:color => color})
|
90
|
+
self.api.add_labels_to_an_issue(@repo, @number, Array(label))
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
# Remove labels from the pull request
|
81
95
|
# @param [[String]] labels
|
82
96
|
# @return [void]
|
83
97
|
#
|
@@ -89,7 +103,7 @@ module Danger
|
|
89
103
|
end
|
90
104
|
end
|
91
105
|
|
92
|
-
#
|
106
|
+
# List current statuses for the head commit
|
93
107
|
# @return [[Hash]]
|
94
108
|
#
|
95
109
|
def statuses
|
@@ -127,22 +141,13 @@ module Danger
|
|
127
141
|
self.api.update_pull_request(@repo, @number, {:body => body})
|
128
142
|
end
|
129
143
|
|
130
|
-
#
|
131
|
-
# @return [Sawyer::Resource]
|
132
|
-
#
|
133
|
-
def close
|
134
|
-
@repo ||= self.pr_json.base.repo.full_name
|
135
|
-
@number ||= self.pr_json.number
|
136
|
-
self.api.update_pull_request(@repo, @number, {:state => 'closed'})
|
137
|
-
end
|
138
|
-
|
139
|
-
# Open the pull request
|
144
|
+
# Update the pull request state
|
140
145
|
# @return [Sawyer::Resource]
|
141
146
|
#
|
142
|
-
def
|
147
|
+
def update_pr_state(state)
|
143
148
|
@repo ||= self.pr_json.base.repo.full_name
|
144
149
|
@number ||= self.pr_json.number
|
145
|
-
self.api.update_pull_request(@repo, @number, {:state =>
|
150
|
+
self.api.update_pull_request(@repo, @number, {:state => state})
|
146
151
|
end
|
147
152
|
end
|
148
153
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-github_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.6.
|
195
|
+
rubygems_version: 2.6.8
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: A longer description of danger-github_ext.
|