git-pulls 0.3.2 → 0.3.4
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.
- data/lib/git-pulls.rb +26 -3
- metadata +9 -7
data/lib/git-pulls.rb
CHANGED
@@ -257,6 +257,24 @@ Usage: git pulls update
|
|
257
257
|
data.select { |p| p['number'].to_s == num.to_s }.first
|
258
258
|
end
|
259
259
|
|
260
|
+
def github_insteadof_matching(c, u)
|
261
|
+
first = c.collect {|k,v| [v, /url\.(.*github\.com.*)\.insteadof/.match(k)]}.
|
262
|
+
find {|v,m| u.index(v) and m != nil}
|
263
|
+
if first
|
264
|
+
return first[0], first[1][1]
|
265
|
+
end
|
266
|
+
return nil, nil
|
267
|
+
end
|
268
|
+
|
269
|
+
def github_user_and_proj(u)
|
270
|
+
# Trouble getting optional ".git" at end to work, so put that logic below
|
271
|
+
m = /github\.com.(.*?)\/(.*)/.match(u)
|
272
|
+
if m
|
273
|
+
return m[1], m[2].sub(/\.git\Z/, "")
|
274
|
+
end
|
275
|
+
return nil, nil
|
276
|
+
end
|
277
|
+
|
260
278
|
def repo_info
|
261
279
|
c = {}
|
262
280
|
config = git('config --list')
|
@@ -265,9 +283,14 @@ Usage: git pulls update
|
|
265
283
|
c[k] = v
|
266
284
|
end
|
267
285
|
u = c['remote.origin.url']
|
268
|
-
|
269
|
-
|
270
|
-
|
286
|
+
|
287
|
+
user, proj = github_user_and_proj(u)
|
288
|
+
if !(user and proj):
|
289
|
+
short, base = github_insteadof_matching(c, u)
|
290
|
+
if short and base
|
291
|
+
u = u.sub(short, base)
|
292
|
+
user, proj = github_user_and_proj(u)
|
293
|
+
end
|
271
294
|
end
|
272
295
|
[user, proj]
|
273
296
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-pulls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 4
|
10
|
+
version: 0.3.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Scott Chacon
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-10 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -52,12 +52,14 @@ dependencies:
|
|
52
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
|
-
- - "
|
55
|
+
- - "="
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
hash:
|
57
|
+
hash: 9
|
58
58
|
segments:
|
59
59
|
- 0
|
60
|
-
|
60
|
+
- 5
|
61
|
+
- 1
|
62
|
+
version: 0.5.1
|
61
63
|
type: :runtime
|
62
64
|
version_requirements: *id003
|
63
65
|
description: git-pulls facilitates github pull requests.
|