git-pulls 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/git-pulls.rb +15 -3
  2. metadata +2 -2
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'date'
2
3
  require 'launchy'
3
4
  require 'octokit'
4
5
 
@@ -134,7 +135,7 @@ Usage: git pulls update
134
135
  line << l(Date.parse(pull['created_at']).strftime("%m/%d"), 5)
135
136
  line << l(pull['comments'], 2)
136
137
  line << l(pull['title'], 35)
137
- line << l(pull['head']['label'], 20)
138
+ line << l(pull['head']['label'], 50)
138
139
  sha = pull['head']['sha']
139
140
  if not_merged?(sha)
140
141
  puts line.join ' '
@@ -167,9 +168,14 @@ Usage: git pulls update
167
168
  repos[repo] = true
168
169
  end
169
170
  end
171
+ if github_credentials_provided?
172
+ endpoint = "git@github.com:"
173
+ else
174
+ endpoint = github_endpoint + "/"
175
+ end
170
176
  repos.each do |repo, bool|
171
177
  puts " fetching #{repo}"
172
- git("fetch #{github_endpoint}/#{repo}.git +refs/heads/*:refs/pr/#{repo}/*")
178
+ git("fetch #{endpoint}#{repo}.git +refs/heads/*:refs/pr/#{repo}/*")
173
179
  end
174
180
  end
175
181
 
@@ -201,8 +207,10 @@ Usage: git pulls update
201
207
 
202
208
  def configure
203
209
  Octokit.configure do |config|
204
- config.login = github_login
210
+ config.login = github_login if github_login and not github_login.empty?
205
211
  config.web_endpoint = github_endpoint
212
+ config.oauth_token = github_token if github_token and not github_token.empty?
213
+ config.proxy = github_proxy if github_proxy and not github_proxy.empty?
206
214
  end
207
215
  end
208
216
 
@@ -223,6 +231,10 @@ Usage: git pulls update
223
231
  end
224
232
  end
225
233
 
234
+ def github_proxy
235
+ git("config --get-all http.proxy")
236
+ end
237
+
226
238
  # API/DATA HELPER FUNCTIONS #
227
239
 
228
240
  def github_credentials_provided?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-pulls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-21 00:00:00.000000000 Z
13
+ date: 2012-11-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json