git-branch--stray 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +1 -1
- data/lib/git/branch/stray.rb +18 -2
- data/lib/git/branch/stray/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 71743dca125cf6a754f34f14b635ad2828680098
|
4
|
+
data.tar.gz: 2a62139dbff48e6237b767ba023ff4fd81ec2626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc9d5d699c6a21945af805e09e9547bd8f53c13cb77d6b7c0781d24cffb41650edf2c89308d2d190f6facd514df0f9c92aeb152504270364cd83c437a997c4a5
|
7
|
+
data.tar.gz: 9c712c1207415d3356faec31f44bd67fe3eae7e6d2a192dacbe27627b9f8df286805e3bafb81f6061cbcb4c076a32708882a2c4e35e4b217ca6debf09cf1e6a3
|
data/Gemfile.lock
CHANGED
data/lib/git/branch/stray.rb
CHANGED
@@ -3,6 +3,20 @@ require 'git/branch/stray/version'
|
|
3
3
|
require 'English'
|
4
4
|
require 'consenter'
|
5
5
|
|
6
|
+
class String
|
7
|
+
def colorize(color_code)
|
8
|
+
"\e[#{color_code}m#{self}\e[0m"
|
9
|
+
end
|
10
|
+
|
11
|
+
def red
|
12
|
+
colorize('31')
|
13
|
+
end
|
14
|
+
|
15
|
+
def yellow
|
16
|
+
colorize('33')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
6
20
|
module Kernel
|
7
21
|
def git(command)
|
8
22
|
`git #{command}`.split($RS).each(&:strip!)
|
@@ -67,16 +81,18 @@ module Git
|
|
67
81
|
}
|
68
82
|
end
|
69
83
|
|
84
|
+
# rubocop:disable Layout/LineLength
|
70
85
|
def delete_stray_branches
|
71
|
-
stray_branches.each_consented('Delete stray branch "%s"') do |stray|
|
86
|
+
stray_branches.each_consented('Delete stray branch "%s"', inspector: :yellow) do |stray|
|
72
87
|
system("git branch -d #{stray}")
|
73
88
|
next if $CHILD_STATUS.success?
|
74
89
|
|
75
|
-
Array(stray).each_consented('Delete unmerged branch "%s"') do |unmerged|
|
90
|
+
Array(stray).each_consented('Delete unmerged branch "%s"', inspector: :red) do |unmerged|
|
76
91
|
system("git branch -D #{unmerged}")
|
77
92
|
end
|
78
93
|
end
|
79
94
|
end
|
95
|
+
# rubocop:enable Layout/LineLength
|
80
96
|
|
81
97
|
def list_stray_branches
|
82
98
|
stray_branches.each do |stray|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-branch--stray
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Vandenberk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: consenter
|
@@ -161,7 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 2.5.2.3
|
165
166
|
signing_key:
|
166
167
|
specification_version: 4
|
167
168
|
summary: Delete stray local remote-tracking branches
|