gub 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gub +1 -1
- data/lib/gub/cli.rb +10 -5
- data/lib/gub/clients/git.rb +10 -5
- data/lib/gub/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8576c0e8367a0d8c054b8b1c0663d897e8212be4
|
4
|
+
data.tar.gz: a55371c54605d614bb343ae0108875e8e70b48e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb5f7d5cc4ea0947141a103b0fa4610abada77a82bee4ca3f8b05f41b6daaba21dd10c29d65befced63f6761e2638f8e8ea860b98e7128e5b58561ef07f5da00
|
7
|
+
data.tar.gz: 924b4d5afa7d1d99e3eebe126969c3d187dde57ea1300a61e80e142deb9b8836a42a277637fd2baee6b3adec81e7d5ecd9563c308c3b788ac8fb8740642ab86f
|
data/bin/gub
CHANGED
data/lib/gub/cli.rb
CHANGED
@@ -78,7 +78,7 @@ module Gub
|
|
78
78
|
row << issue.title
|
79
79
|
row << issue.user.login
|
80
80
|
row << (issue.assignee.nil? ? '' : issue.assignee.login)
|
81
|
-
row << issue.
|
81
|
+
row << issue.state
|
82
82
|
rows << row
|
83
83
|
end
|
84
84
|
say table rows, ['ID', 'Title', 'Author', 'Assignee', 'Status']
|
@@ -94,10 +94,15 @@ module Gub
|
|
94
94
|
if id.nil?
|
95
95
|
panic 'Issue ID required.'
|
96
96
|
else
|
97
|
-
|
98
|
-
Gub.git.
|
99
|
-
|
100
|
-
|
97
|
+
branch = "issue-#{id}"
|
98
|
+
if Gub.git.branch().include?('issue-111')
|
99
|
+
Gub.git.checkout(branch)
|
100
|
+
else
|
101
|
+
repository = Repository.new
|
102
|
+
Gub.git.sync
|
103
|
+
repository.assign_issue id
|
104
|
+
Gub.git.checkout('-b', branch)
|
105
|
+
end
|
101
106
|
end
|
102
107
|
rescue Gub::Unauthorized
|
103
108
|
reauthorize
|
data/lib/gub/clients/git.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'open3'
|
2
|
+
|
1
3
|
module Gub
|
2
4
|
class Git
|
3
5
|
attr_accessor :default_options
|
@@ -30,14 +32,17 @@ module Gub
|
|
30
32
|
cmd = []
|
31
33
|
cmd << 'git'
|
32
34
|
cmd << command
|
33
|
-
|
34
|
-
|
35
|
-
|
35
|
+
if args.any?
|
36
|
+
arguments = args
|
37
|
+
unless ['clone', 'remote', 'checkout'].include?(command)
|
38
|
+
arguments = arguments.zip(default_options).flatten!
|
39
|
+
end
|
40
|
+
cmd << arguments.join(' ').to_s
|
36
41
|
end
|
37
|
-
cmd << arguments.join(' ').to_s
|
38
42
|
cmd_line = cmd.join(' ')
|
39
43
|
Gub.log.debug "Running git command: #{cmd_line}"
|
40
|
-
`#{cmd_line}
|
44
|
+
out = `#{cmd_line}`.split("\n").map(&:strip)
|
45
|
+
out
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
data/lib/gub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Omar Abdel-Wahab
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -160,4 +160,3 @@ signing_key:
|
|
160
160
|
specification_version: 4
|
161
161
|
summary: The missing command line tool for Github
|
162
162
|
test_files: []
|
163
|
-
has_rdoc:
|