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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4ad5ef56a6846466989a540dc698566b62e95eb
4
- data.tar.gz: f65b4ce96879f5a071ad2da20cd212aad7888ccd
3
+ metadata.gz: 7ab95a199e23c8ea5ec3e08e43feb92198fa59ab
4
+ data.tar.gz: 19da981dc308bd704faf700938dd1379665a092b
5
5
  SHA512:
6
- metadata.gz: 74d77f068c03c1cc933e49efa4e0f783d0742d6954993c8014daf32cb6370dd845fb0b6f93aedf7ff65a9fc460101d2ba00ecc6547190c464865768f62f1420c
7
- data.tar.gz: 38e70228acb66ed9def892bbb0bcc1eb4b3309ba6cf4d43095f6c0cddfe75651a49372f65b9479210a854973af91e5edbdc5fb1efb334f76c7c22b269427f1ad
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 config.update_status && config.add_comment
38
+ if update_status? && add_comment?
39
39
  receive_test_status
40
40
  receive_test_comment
41
- elsif config.update_status
41
+ elsif update_status?
42
42
  receive_test_status
43
- elsif config.add_comment
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 config.update_status
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 config.add_comment
126
+ if add_comment?
119
127
  if !comment_present?
120
128
  body = {
121
129
  body: COMMENT_BODY % @payload["compare_url"]
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Services
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
5
5
  end
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.0
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-02-17 00:00:00.000000000 Z
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.4.7
240
+ rubygems_version: 2.0.14
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: Service classes for Code Climate