git_left 0.1.2 → 0.1.3

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: a2ed757ebc1fe0dd43a521586a07f39f75a7d278
4
- data.tar.gz: 00be165a1a6fe1f382618125f33e6815a04c8a53
3
+ metadata.gz: 70e1da0581b561e432b0676c50e4fe84ccc681e0
4
+ data.tar.gz: 6a5e54ab4e3d39c3345db03d53ca578334662141
5
5
  SHA512:
6
- metadata.gz: 7c7441e6cfa668114cd08afbbf3d543bbd9e91c89ef6f98a0a3797c3231ce417845e8634843b0247e6395cfd707663b34dd34071681ed0086226316c0c1021d5
7
- data.tar.gz: 5a328e417fd3955f1d39206992012cdf1383b3cf2eac5678efd21ca96491f05d943605741c6441524cf86bf77670ea83ffea1866386f06218c20e0157cc68d50
6
+ metadata.gz: abda837f7ea2d42bf79dde62b731a5f30817e3c42bd77d2be87a7202d6fd07a84dbfb8fb5f3c75d41cfbe8b8ecc2c38c078f6db2f4a507db5dcbd0817a405eb7
7
+ data.tar.gz: 255be76e956cfe0120cd8baeed77d6a2dd74c3c00c1f77546039d2c26ff7469eec7ef961242c18cfb1358bd6e2366b4a96e1f051279411041c10b7d9a104fc12
@@ -32,8 +32,8 @@ module GitLeft
32
32
  @@skipped_branches ||= []
33
33
  @@deleted_branches ||= []
34
34
 
35
- @@all_branches = Git.open('.').branches.to_a
36
- @@all_branches.select { |b| !branches_to_omit.include?(b.name) }
35
+ @@all_branches ||= Git.open('.').branches.to_a
36
+ @@all_branches.select { |b| !branches_to_omit.include?(b.name) && !b.remote }
37
37
  end
38
38
  end
39
39
  end
data/lib/git_left/cli.rb CHANGED
@@ -8,30 +8,35 @@ module GitLeft
8
8
  puts "Time to clean up your #{GitLeft::Branches.branches.count} local branches..."
9
9
 
10
10
  while(1) do
11
- random_branch = GitLeft::Branches.random_branch
11
+ begin
12
+ @random_branch = GitLeft::Branches.random_branch
12
13
 
13
- if random_branch.nil?
14
- puts "\nYou cleaned up all your branches!"
15
- puts "\t#{GitLeft::Branches.skipped_branches.count} skipped"
16
- puts "\t#{GitLeft::Branches.deleted_branches.count} deleted"
17
- break
18
- end
14
+ if @random_branch.nil?
15
+ puts "\nYou cleaned up all your branches!"
16
+ puts "\t#{GitLeft::Branches.skipped_branches.count} skipped"
17
+ puts "\t#{GitLeft::Branches.deleted_branches.count} deleted"
18
+ break
19
+ end
19
20
 
20
- underlined = "\e[4m" << random_branch.name << "\e[24m"
21
- puts "\nDeciding time: #{underlined} (h to delete, l to skip, anything else to quit)\n"
21
+ underlined = "\e[4m" << @random_branch.name << "\e[24m"
22
+ puts "\nDeciding time: #{underlined} (h to delete, l to skip, anything else to quit)\n"
22
23
 
23
- case GitLeft::KeyParser.new(STDIN.getch).action
24
- when :delete
25
- GitLeft::Branches.delete(random_branch)
26
- puts "#{random_branch.name} deleted"
27
- next
28
- when :skip
29
- GitLeft::Branches.skip(random_branch)
30
- puts "#{random_branch.name} skipped"
31
- next
32
- when :quit
33
- puts "See ya!"
34
- break
24
+ case GitLeft::KeyParser.new(STDIN.getch).action
25
+ when :delete
26
+ GitLeft::Branches.delete(@random_branch)
27
+ puts "#{@random_branch.name} deleted"
28
+ next
29
+ when :skip
30
+ GitLeft::Branches.skip(@random_branch)
31
+ puts "#{@random_branch.name} skipped"
32
+ next
33
+ when :quit
34
+ puts "See ya!"
35
+ break
36
+ end
37
+ rescue
38
+ puts "A problem occurred performing that action. Skipping."
39
+ GitLeft::Branches.skip(@random_branch)
35
40
  end
36
41
  end
37
42
  end
@@ -1,3 +1,3 @@
1
1
  module GitLeft
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/git_left.rb CHANGED
@@ -1,7 +1,7 @@
1
- require "git_left/version"
2
- require "git_left/branches"
3
- require "git_left/key_parser"
4
- require "git_left/cli"
1
+ require_relative "git_left/version"
2
+ require_relative "git_left/branches"
3
+ require_relative "git_left/key_parser"
4
+ require_relative "git_left/cli"
5
5
 
6
6
  module GitLeft
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_left
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuck Callebs