everypolitician-pull_request 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 992468ae0a956df5932c7fef0f1c3113e3b33862
4
- data.tar.gz: b9f3da521445ec749b3a350b213680b9ea9300b1
3
+ metadata.gz: f0f118d7f5c1153eb2d5fdda7553fb308dd447a6
4
+ data.tar.gz: 80154d1941abdffab0de37882141e8b70e124996
5
5
  SHA512:
6
- metadata.gz: 121f2fd5500bc183b41f02aae5fa897af6e21e5f842146557b378b0fb2546c517472b7abeac663b9bf52ae00b4688619e35c213ae2e1804c45bd16181c3c118d
7
- data.tar.gz: 65731efebba647c13a95a7f0c27c66ed48ec2488ca4692bff7b2f9c0e65959539b2e383fe9aabb2335a5f879134af2e2da2cf828e3b56a845502e32ee1553528
6
+ metadata.gz: 0e121428905079e2cfe39a00d7729742f5949470cb94c65c8ae02db5baf1462bd30d7b282285252f87fd40ba585bbf882af37a386d51b6578df2088c38a98a61
7
+ data.tar.gz: 90aeafd6ff798790bf05680ac0e9802282fd55f887fd63a42ba340238a0da087b5033b80ee689df61ff9478b78ecdb23242284c9cfb7bc50463df11d3f4c569f
@@ -30,6 +30,26 @@ module Everypolitician
30
30
  end
31
31
  end
32
32
 
33
+ def post_to_github
34
+ comment = github.add_comment(
35
+ everypolitician_data_repo,
36
+ pull_request_number,
37
+ as_markdown
38
+ )
39
+ puts "Success! Comment posted at #{comment[:html_url]}"
40
+ rescue Octokit::Unauthorized
41
+ abort 'unauthorized: Please set GITHUB_ACCESS_TOKEN in the ' \
42
+ 'environment and try again. https://github.com/settings/tokens'
43
+ end
44
+
45
+ def post_to_github_from_travis
46
+ if pull_request_number && pull_request_number != 'false'
47
+ post_to_github
48
+ else
49
+ warn 'Not building a pull request, skipping pull_request_summary'
50
+ end
51
+ end
52
+
33
53
  private
34
54
 
35
55
  def github
@@ -1,5 +1,5 @@
1
1
  module Everypolitician
2
2
  module PullRequest
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everypolitician-pull_request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Mytton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2016-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: everypolitician-popolo