git_left 0.1.5 → 0.1.6

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: a3e46a886eb70a83525ea9fe099720d26528ffee
4
- data.tar.gz: 602e8bf8edcf4717b8497af2fc7409a06fbff15a
3
+ metadata.gz: aa1e3068dbc63db5b50e500d87c19a52a288199c
4
+ data.tar.gz: 1425caa086c621685df77efdc5635ec0e3d440f0
5
5
  SHA512:
6
- metadata.gz: cf5b45b759a77eae2e2d1755a8f281b82269e8738cbf99ba6b4954b522fded24586f3759e47c9390a798aa2d718e788507a2684915f13b610cf3b13bd45bdd10
7
- data.tar.gz: 13b33a9e951ec6f0ba12f79fc1cb6ea3a5043faeed836d76a37dcefdecfa24280725d9a18f83fd52f24853618a0fe289b14f16d78f66e00dc38b17e02f2c19be
6
+ metadata.gz: d4ff95301b74e74b6eb7879fb044a631d68d96d6c67325f8f7c7d33ba03d4d04d0942d9e17a114b9e0b4f64a951b3a5c0785faaf04f5e30f489a057873e139e5
7
+ data.tar.gz: c2afb40d31554f83dec1d99889bd51f6ece2e29efa36d9e16ce3dc64b8b4038f863a8694f4246ccb115190a9566f47e8ec571e2d6977bec28e9c9fe9d42cc115
data/README.md CHANGED
@@ -11,16 +11,19 @@ Install it yourself:
11
11
 
12
12
  $ gem install git_left
13
13
 
14
- ## Usage
14
+ ## Commands
15
15
 
16
16
  ```
17
17
  git_left begin
18
18
  ```
19
19
 
20
+ Begins session to evaluate git branches and decide whether to delete them or
21
+ save them for later.
22
+
20
23
  #### Sample session:
21
24
 
22
25
  ```
23
- ➜ git_left git:(master) ./bin/git_left begin
26
+ ➜ git_left git:(master) git_left begin
24
27
  Time to clean up your 4 local branches...
25
28
 
26
29
  Deciding time: four-branch (h to delete, l to skip, anything else to quit)
@@ -40,6 +43,29 @@ You cleaned up all your branches!
40
43
  1 deleted
41
44
  ```
42
45
 
46
+ -------
47
+
48
+ ```
49
+ git_left yolo
50
+ ```
51
+
52
+ Deletes every local git branch in the current repository.
53
+
54
+ #### Sample session:
55
+
56
+ ```
57
+ ➜ git_left git:(master) ✗ git_left yolo
58
+ Are you absolutely sure you want to delete your 4 local branches? (y/n)
59
+ I'm serious, this is not easily undone. Go through with it? (y/n)
60
+ Okay...
61
+ two-branch deleted.
62
+ one-branch deleted.
63
+ three-branch deleted.
64
+ four-branch deleted.
65
+ ➜ git_left git:(master) ✗ git branch
66
+ * master
67
+ ```
68
+
43
69
  ## Development
44
70
 
45
71
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/git_left.rb CHANGED
@@ -1,10 +1,12 @@
1
- require_relative "git/lib"
1
+ require 'git'
2
+
2
3
  require_relative "git_left/version"
3
4
  require_relative "git_left/branch"
4
5
  require_relative "git_left/branch_reporter"
5
6
  require_relative "git_left/branches"
6
7
  require_relative "git_left/key_parser"
7
8
  require_relative "git_left/cli"
9
+ require_relative "overrides/git/lib"
8
10
 
9
11
  module GitLeft
10
12
  end
data/lib/git_left/cli.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require "thor"
2
- require "git"
3
2
 
4
3
  module GitLeft
5
4
  class CLI < Thor
@@ -43,6 +42,27 @@ module GitLeft
43
42
  GitLeft::Branches.skip(@random_branch)
44
43
  end
45
44
  end
45
+
46
+ puts "\t#{GitLeft::Branches.skipped_branches.count} skipped"
47
+ puts "\t#{GitLeft::Branches.deleted_branches.count} deleted"
48
+ end
49
+
50
+ desc "yolo", "Delete all branches"
51
+ def yolo(opts = {})
52
+ puts "Are you absolutely sure you want to delete your #{GitLeft::Branches.branches.count} local branches? (y/n)"
53
+
54
+ if STDIN.getch == 'y'
55
+ puts "I'm serious, this is not easily undone. Go through with it? (y/n)"
56
+
57
+ if STDIN.getch == 'y'
58
+ puts "Okay..."
59
+
60
+ while branch = GitLeft::Branches.random_branch do
61
+ GitLeft::Branches.delete(branch)
62
+ puts "#{branch.name} deleted."
63
+ end
64
+ end
65
+ end
46
66
  end
47
67
  end
48
68
  end
@@ -1,3 +1,3 @@
1
1
  module GitLeft
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -0,0 +1,19 @@
1
+ module OverrideConfigList
2
+ def config_list
3
+ build_list = lambda do |path|
4
+ parse_config_list command_lines('config', ['--list'])
5
+ end
6
+
7
+ @config_list ||= begin
8
+ if @git_dir
9
+ Dir.chdir(@git_dir, &build_list)
10
+ else
11
+ build_list.call
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ class Git::Lib
18
+ prepend OverrideConfigList
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_left
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuck Callebs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -113,7 +113,6 @@ files:
113
113
  - bin/git_left
114
114
  - bin/setup
115
115
  - git_left.gemspec
116
- - lib/git/lib.rb
117
116
  - lib/git_left.rb
118
117
  - lib/git_left/branch.rb
119
118
  - lib/git_left/branch_reporter.rb
@@ -121,6 +120,7 @@ files:
121
120
  - lib/git_left/cli.rb
122
121
  - lib/git_left/key_parser.rb
123
122
  - lib/git_left/version.rb
123
+ - lib/overrides/git/lib.rb
124
124
  homepage: http://github.com/ccallebs/git_left
125
125
  licenses:
126
126
  - MIT
data/lib/git/lib.rb DELETED
@@ -1,17 +0,0 @@
1
- module Git
2
- class Lib
3
- def config_list
4
- build_list = lambda do |path|
5
- parse_config_list command_lines('config', ['--list'])
6
- end
7
-
8
- @config_list ||= begin
9
- if @git_dir
10
- Dir.chdir(@git_dir, &build_list)
11
- else
12
- build_list.call
13
- end
14
- end
15
- end
16
- end
17
- end