gitcycle 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/gitcycle.gemspec +1 -1
  2. data/lib/gitcycle.rb +16 -1
  3. metadata +3 -3
data/gitcycle.gemspec CHANGED
@@ -6,7 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "gitcycle"
9
- s.version = '0.2.5'
9
+ s.version = '0.2.6'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = [ 'Winton Welsh' ]
12
12
  s.email = [ 'mail@wintoni.us' ]
data/lib/gitcycle.rb CHANGED
@@ -75,6 +75,20 @@ class Gitcycle
75
75
  end
76
76
  alias :co :checkout
77
77
 
78
+ def commit_all
79
+ branch_info = get('branch',
80
+ 'branch[name]' => branches(:current => true),
81
+ 'create' => 0
82
+ )
83
+
84
+ if branch_info && (title = branch_info["title"]) && id = branch_info["body"].match(/#\d+/)
85
+ commit_msg = "[#{id}] #{title}"
86
+ end
87
+
88
+ run "git add . && git commit -am" + (commit_msg ? " \"#{commit_msg}\"" : "")
89
+ end
90
+ alias :ca :commit_all
91
+
78
92
  def create_branch(url_or_title, reset=false)
79
93
  require_git && require_config
80
94
 
@@ -634,7 +648,8 @@ class Gitcycle
634
648
  exit
635
649
  end
636
650
 
637
- error = json.match(/Gitcycle error reference code (\d+)/)[1]
651
+ match = json.match(/Gitcycle error reference code (\d+)/)
652
+ error = match && match[1]
638
653
 
639
654
  if error
640
655
  puts "\nSomething went wrong :(".red
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitcycle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 5
10
- version: 0.2.5
9
+ - 6
10
+ version: 0.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Winton Welsh