git-pulls 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/git-pulls.rb +19 -0
- metadata +2 -2
data/lib/git-pulls.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'rubygems'
|
1
2
|
require 'json'
|
2
3
|
require 'date'
|
3
4
|
require 'launchy'
|
@@ -250,10 +251,13 @@ Usage: git pulls update
|
|
250
251
|
|
251
252
|
def configure
|
252
253
|
Octokit.configure do |config|
|
254
|
+
|
253
255
|
config.login = github_login if github_login and not github_login.empty?
|
254
256
|
config.web_endpoint = github_endpoint
|
255
257
|
config.oauth_token = github_token if github_token and not github_token.empty?
|
256
258
|
config.proxy = github_proxy if github_proxy and not github_proxy.empty?
|
259
|
+
config.api_endpoint = github_api_endpoint if (github_api_endpoint and \
|
260
|
+
not github_api_endpoint.empty?)
|
257
261
|
end
|
258
262
|
end
|
259
263
|
|
@@ -273,6 +277,15 @@ Usage: git pulls update
|
|
273
277
|
'https://github.com'
|
274
278
|
end
|
275
279
|
end
|
280
|
+
def github_api_endpoint
|
281
|
+
endpoint = git("config --get-all github.api")
|
282
|
+
if endpoint.size > 0
|
283
|
+
endpoint
|
284
|
+
else
|
285
|
+
'https://api.github.com'
|
286
|
+
end
|
287
|
+
|
288
|
+
end
|
276
289
|
|
277
290
|
def github_proxy
|
278
291
|
git("config --get-all http.proxy")
|
@@ -333,6 +346,12 @@ Usage: git pulls update
|
|
333
346
|
if m
|
334
347
|
return m[1], m[2].sub(/\.git\Z/, "")
|
335
348
|
end
|
349
|
+
# that works with default github but not enterprise
|
350
|
+
# u is probably something like: git@github.hq.corp.lan:SomeGroup/some_repo.git
|
351
|
+
m = /.*?:(.*)\/(.*?)\.git/.match(u)
|
352
|
+
if m
|
353
|
+
return m[1], m[2]
|
354
|
+
end
|
336
355
|
return nil, nil
|
337
356
|
end
|
338
357
|
|
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.
|
4
|
+
version: 0.3.11
|
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: 2013-
|
13
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|