mj 1.0.1 → 1.1.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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89e001fe208b12ec28ecf985f50e778fcfc295171c28b5fbeff5329711aeb1bb
|
4
|
+
data.tar.gz: 92b72966a17d0753e46823a5e7d6b4359b8753347d415025b4d3b40b5d5c8fd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83db7c1361d041476e30e1c8818f7d873603a27e0ab11d773b05d9603b3388fc374192ae5f37af6df430f42a5884860f982e45e09e97cec62c1ea343e3ca4408
|
7
|
+
data.tar.gz: bf0ed35c9eb853c1e617abbeced2fa9b2e710cdca2f76ef853e538f4c5f64ccb9d131aaca9c93701b3e6790ed0a342ba144c8140145c4d43c7d3c7da37a24b1a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mj (1.0
|
4
|
+
mj (1.1.0)
|
5
5
|
colorize
|
6
6
|
koine-rest_client
|
7
7
|
mj-hash_utils
|
@@ -111,7 +111,7 @@ GEM
|
|
111
111
|
strscan (3.1.0)
|
112
112
|
thor (1.2.2)
|
113
113
|
unicode-display_width (2.5.0)
|
114
|
-
uri (0.13.
|
114
|
+
uri (0.13.1)
|
115
115
|
|
116
116
|
PLATFORMS
|
117
117
|
arm64-darwin-23
|
data/README.md
CHANGED
@@ -12,6 +12,19 @@ module Mj
|
|
12
12
|
@options[:dry_run]
|
13
13
|
end
|
14
14
|
|
15
|
+
def after_date
|
16
|
+
if @after_date
|
17
|
+
return @after_date
|
18
|
+
end
|
19
|
+
|
20
|
+
if @options[:after_date]
|
21
|
+
@after_date ||= DateTime.parse(@options[:after_date])
|
22
|
+
end
|
23
|
+
|
24
|
+
# Default to 100+ years ago - sure there are no commits that old
|
25
|
+
@after_date ||= DateTime.new(1900, 1, 1, 0, 0, 0)
|
26
|
+
end
|
27
|
+
|
15
28
|
def before_date
|
16
29
|
if @before_date
|
17
30
|
return @before_date
|
@@ -43,7 +43,12 @@ module Mj
|
|
43
43
|
end
|
44
44
|
|
45
45
|
if branch.last_commit_date >= command.before_date
|
46
|
-
puts("Skipping #{branch.name}. Not before #{command.before_date}", color: :yellow)
|
46
|
+
puts("Skipping #{branch.name}. Not before #{command.before_date}.", color: :yellow)
|
47
|
+
return false
|
48
|
+
end
|
49
|
+
|
50
|
+
if branch.last_commit_date < command.after_date
|
51
|
+
puts("Skipping #{branch.name}. Not after #{command.after_date}.", color: :yellow)
|
47
52
|
return false
|
48
53
|
end
|
49
54
|
|
@@ -63,7 +68,7 @@ module Mj
|
|
63
68
|
def delete(branch)
|
64
69
|
branch.delete
|
65
70
|
rescue Mj::Git::CommandExecuter::Error => exception
|
66
|
-
puts("Could not delete branch #{branch.name}: #{exception.message}", color: :red)
|
71
|
+
puts("Could not delete branch #{branch.name}: #{exception.message}.", color: :red)
|
67
72
|
end
|
68
73
|
|
69
74
|
def puts(string, color: nil)
|
data/lib/mj/git/thor_command.rb
CHANGED
@@ -30,6 +30,10 @@ module Mj
|
|
30
30
|
type: :boolean,
|
31
31
|
banner: "Do not delete if PRs are in DRAFT or OPEN - will they maybe be merged?",
|
32
32
|
aliases: :c
|
33
|
+
option :after_date,
|
34
|
+
type: :string,
|
35
|
+
banner: "Formatted date YYY-MM-DD",
|
36
|
+
aliases: :a
|
33
37
|
option :before_date,
|
34
38
|
type: :string,
|
35
39
|
banner: "Formatted date YYY-MM-DD",
|
data/lib/mj/version.rb
CHANGED