dorian-git-tree 0.5.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/git-tree +26 -23
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 337280e32b361b2da4147ef3e0045e4911525c4908a6c8b7b3ccfa68f628b39e
|
4
|
+
data.tar.gz: 451275eb2cdc74292237e6b9d208a308b080505acc7e9b2de8dd3173d65287a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ac6959cd4aff84183d08e08859697ede04cddbd1535fde3d69644d31f26fb83aaf2bfb3d4930004b4b7cf78fd668d72421a5652718d821be82c7fd887e37d89
|
7
|
+
data.tar.gz: 8df6e922d3e61cd0f45cb59db7049d629763639a42d5430eb044cbd7c441045e129b4ea55e16a7ede4fb83ac33239cd2ceb02b7bb07000594ab5ff2c26740a67
|
data/bin/git-tree
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "git"
|
5
|
+
require "dorian/arguments"
|
6
|
+
|
7
|
+
parsed = Dorian::Arguments.parse(version: { alias: :v }, help: { alias: :h })
|
8
|
+
|
9
|
+
abort parsed.help if parsed.options.help
|
10
|
+
|
11
|
+
if parsed.options.version
|
12
|
+
abort File.read(File.expand_path("../VERSION", __dir__))
|
13
|
+
end
|
5
14
|
|
6
15
|
SPACE = " "
|
7
16
|
RIGHT = "└── "
|
@@ -38,27 +47,21 @@ def print(key:, values:, index: 0, size: 1, prefix: "")
|
|
38
47
|
end
|
39
48
|
end
|
40
49
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
print(
|
59
|
-
key: value_key,
|
60
|
-
values: value_values,
|
61
|
-
index: value_index,
|
62
|
-
size: values.size
|
63
|
-
)
|
50
|
+
keys = parsed.arguments.any? ? parsed.arguments : ["."]
|
51
|
+
keys.each do |key|
|
52
|
+
files =
|
53
|
+
git_ls_files(key).map do |file|
|
54
|
+
parsed.arguments.any? ? file.sub(key, "") : file
|
55
|
+
end
|
56
|
+
values = group(files)
|
57
|
+
key = "#{key}/" if values.any? && key != "." && key[-1] != "/"
|
58
|
+
puts key
|
59
|
+
values.each.with_index do |(value_key, value_values), value_index|
|
60
|
+
print(
|
61
|
+
key: value_key,
|
62
|
+
values: value_values,
|
63
|
+
index: value_index,
|
64
|
+
size: values.size
|
65
|
+
)
|
66
|
+
end
|
64
67
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorian-git-tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: dorian-arguments
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: git
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -57,9 +57,9 @@ require_paths:
|
|
57
57
|
- lib
|
58
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: 3.3.4
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - ">="
|