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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c34013ffa3a6dd074cc20b2c444daa3d098ddd5
4
- data.tar.gz: 2d9571b41254e697ba4a39580acd2f39c78b558b
3
+ metadata.gz: 8576c0e8367a0d8c054b8b1c0663d897e8212be4
4
+ data.tar.gz: a55371c54605d614bb343ae0108875e8e70b48e1
5
5
  SHA512:
6
- metadata.gz: a876cee97d4f8af56f9435949ca16e0ed689a59e3adef6c1515c81047693d291de4e56bd8bef15278e6ee66a7f7638e694830abbc61cdff4676c0075eeb2cc53
7
- data.tar.gz: aff50cfb351cd7c96ac0fa226161daf7e60862355817c5840edeca5512c04389208b5f198458e218b28e81837f3bdf297df30f9cf01b122653b23ffe0076fd26
6
+ metadata.gz: bb5f7d5cc4ea0947141a103b0fa4610abada77a82bee4ca3f8b05f41b6daaba21dd10c29d65befced63f6761e2638f8e8ea860b98e7128e5b58561ef07f5da00
7
+ data.tar.gz: 924b4d5afa7d1d99e3eebe126969c3d187dde57ea1300a61e80e142deb9b8836a42a277637fd2baee6b3adec81e7d5ecd9563c308c3b788ac8fb8740642ab86f
data/bin/gub CHANGED
@@ -3,7 +3,7 @@
3
3
  debug = false
4
4
  if ENV.include?('GUB_ENV') && ENV['GUB_ENV'] == 'development'
5
5
  debug = true
6
- $:<< File.expand_path("~/Projects/gub/lib/")
6
+ $:<< File.expand_path("~/Projects/Github/gub/lib/")
7
7
  end
8
8
 
9
9
  require 'gub'
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.status
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
- repository = Repository.new
98
- Gub.git.sync
99
- repository.assign_issue id
100
- Gub.git.checkout('-b', "issue-#{id}")
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
@@ -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
- arguments = args
34
- unless ['clone', 'remote', 'checkout'].include?(command)
35
- arguments = arguments.zip(default_options).flatten!
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
@@ -1,3 +1,3 @@
1
1
  module Gub
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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
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-03 00:00:00.000000000 Z
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: