committer-tools 0.1.6 → 0.1.7

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: 9c1b0c5d7a2cf1ca37e042058c277cfcb776212b
4
- data.tar.gz: d5cf6a9ba4d2142832f11a9af944d8690904142e
3
+ metadata.gz: fcaad1fc901c04101cd063b39b78a34adfdc2b4c
4
+ data.tar.gz: c7423a9a9f38ca64453829407d8e2f626cd3575a
5
5
  SHA512:
6
- metadata.gz: 8b50ab7749d1822f41e28978f2f0cf64b5b2dbc84e96698a552bae06fe630f8761f06bf0013f0a1f523625863a4b80d9baeab83143e3fdfe2d7334bce13a88e1
7
- data.tar.gz: fa34264facecfe16a65373a8c2c3ea4df53f593c4cb45d3cc08de9a918558d0fb9185efc12f8a3bd2c58e53854c0c2ae70f1dd8cf1731cf96625d47794849ee2
6
+ metadata.gz: ce9881ab452e6d79b800906cd84112c83da8d5efb35b704050f9e53844961f9ca290b33c82fcb92a0d285da3cb67e6eee4e765eb21251f66ff513beea38ae7c6
7
+ data.tar.gz: ebcbafcea24a3b5d11efedeb72494060be24abacfeb0a51c4e85d49dcf45b111df2026ac6eb258d5c243842330b37df39c76ccfb4ab9894bdae761614071134c
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'committer-tools'
5
- spec.version = '0.1.6'
5
+ spec.version = '0.1.7'
6
6
  spec.authors = 'Jon Moss'
7
7
  spec.email = 'me@jonathanmoss.me'
8
8
 
@@ -2,20 +2,17 @@ require 'json'
2
2
  require 'rest-client'
3
3
 
4
4
  class HTTPHelper
5
+ class << self
6
+ attr_writer :token
7
+ end
8
+
5
9
  def self.get(url)
6
- RestClient.get(url, { params: { access_token: @@token } }).body
10
+ RestClient.get(url, { params: { access_token: @token } }).body
7
11
  end
8
12
 
9
13
  def self.get_json(url)
10
14
  JSON.parse(get(url))
11
15
  end
12
-
13
- def self.with_auth(token, &block)
14
- @@token = token
15
- ret = yield block
16
- @@token = nil
17
- ret
18
- end
19
16
  end
20
17
 
21
18
  class Lander
@@ -141,10 +138,9 @@ class Preparer
141
138
  AUTH_FILE = '.ctconfig'
142
139
 
143
140
  def run
144
- HTTPHelper.with_auth(get_auth) do
145
- pr = get_pr()
146
- get_github_pr(pr)
147
- end
141
+ HTTPHelper.token = get_auth()
142
+ pr = get_pr()
143
+ get_github_pr(pr)
148
144
  end
149
145
 
150
146
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: committer-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Moss
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client