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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 14244864681944cc4d3e527074d75f5a1a962492c0893039f99262cb3f95a14d
4
- data.tar.gz: 8d88fa776084940b16c047ae4e93cb5d7ed981455403742dc4394c1d21c51a14
2
+ SHA1:
3
+ metadata.gz: 71743dca125cf6a754f34f14b635ad2828680098
4
+ data.tar.gz: 2a62139dbff48e6237b767ba023ff4fd81ec2626
5
5
  SHA512:
6
- metadata.gz: 5000527678d208afa1acd04a3316889d77549389fcbc0f96d2dd3c70be05693605d57d65571c1cc3bd82b737e68f6140d7b569cbf5119cb4c37585c1471403f7
7
- data.tar.gz: 3ee163d8012c5801c73ea16d9b04c451d7884b8f844ef60c5640756b062195f9302fe4153f7de714b99eaa87d06f3a795802c57ea5f5d86f16f53bca1b63c0df
6
+ metadata.gz: bc9d5d699c6a21945af805e09e9547bd8f53c13cb77d6b7c0781d24cffb41650edf2c89308d2d190f6facd514df0f9c92aeb152504270364cd83c437a997c4a5
7
+ data.tar.gz: 9c712c1207415d3356faec31f44bd67fe3eae7e6d2a192dacbe27627b9f8df286805e3bafb81f6061cbcb4c076a32708882a2c4e35e4b217ca6debf09cf1e6a3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-branch--stray (1.6.0)
4
+ git-branch--stray (1.7.0)
5
5
  consenter (~> 1.0)
6
6
 
7
7
  GEM
@@ -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|
@@ -2,7 +2,7 @@ module Git
2
2
  module Branch
3
3
  module Stray
4
4
  NAME = 'git-branch--stray'.freeze
5
- VERSION = '1.6.0'.freeze
5
+ VERSION = '1.7.0'.freeze
6
6
 
7
7
  def self.version
8
8
  "#{NAME} v#{VERSION}"
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.6.0
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: 2019-07-10 00:00:00.000000000 Z
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
- rubygems_version: 3.0.4
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