codeclimate-services 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cc/services/github_pull_requests.rb +13 -5
- data/lib/cc/services/version.rb +1 -1
- 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: 7ab95a199e23c8ea5ec3e08e43feb92198fa59ab
|
4
|
+
data.tar.gz: 19da981dc308bd704faf700938dd1379665a092b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46e2ca4b77e147074f6a274fd15f2266009e7d229fed6b27f778ea1e2e23a3616cbcd8202ba813bb0e31c26df5bf0c019b10f2878b910e317eb9f94a83282af9
|
7
|
+
data.tar.gz: 96fa02d19dad4b5ccbc4a3f2854d6fd552dbac25ce0e80123d2f6dc0f4f851887c4b3edfa1f945abf91c80f26bd398c299b07face264b92410aa49ef35d154c4
|
@@ -35,12 +35,12 @@ class CC::Service::GitHubPullRequests < CC::Service
|
|
35
35
|
def receive_test
|
36
36
|
setup_http
|
37
37
|
|
38
|
-
if
|
38
|
+
if update_status? && add_comment?
|
39
39
|
receive_test_status
|
40
40
|
receive_test_comment
|
41
|
-
elsif
|
41
|
+
elsif update_status?
|
42
42
|
receive_test_status
|
43
|
-
elsif
|
43
|
+
elsif add_comment?
|
44
44
|
receive_test_comment
|
45
45
|
else
|
46
46
|
simple_failure("Nothing happened")
|
@@ -62,6 +62,14 @@ class CC::Service::GitHubPullRequests < CC::Service
|
|
62
62
|
|
63
63
|
private
|
64
64
|
|
65
|
+
def add_comment?
|
66
|
+
[true, "1"].include?(config.add_comment)
|
67
|
+
end
|
68
|
+
|
69
|
+
def update_status?
|
70
|
+
[true, "1"].include?(config.update_status)
|
71
|
+
end
|
72
|
+
|
65
73
|
def simple_failure(message)
|
66
74
|
{ ok: false, message: message }
|
67
75
|
end
|
@@ -103,7 +111,7 @@ private
|
|
103
111
|
end
|
104
112
|
|
105
113
|
def update_status(state, description)
|
106
|
-
if
|
114
|
+
if update_status?
|
107
115
|
params = {
|
108
116
|
state: state,
|
109
117
|
description: description,
|
@@ -115,7 +123,7 @@ private
|
|
115
123
|
end
|
116
124
|
|
117
125
|
def add_comment
|
118
|
-
if
|
126
|
+
if add_comment?
|
119
127
|
if !comment_present?
|
120
128
|
body = {
|
121
129
|
body: COMMENT_BODY % @payload["compare_url"]
|
data/lib/cc/services/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Helmkamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
version: '0'
|
238
238
|
requirements: []
|
239
239
|
rubyforge_project:
|
240
|
-
rubygems_version: 2.
|
240
|
+
rubygems_version: 2.0.14
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: Service classes for Code Climate
|