dorian-git-tree 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dorian/git/tree.rb +9 -7
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb002166fb2e78caa5668ba160022eb5765d2d372ab811fff3041164d8726d7e
|
4
|
+
data.tar.gz: 1ee4d98c0b4c7aae9ea5bc26caa60deb0f53bd5ed48f032a6053eec2691c1bbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f308c7395bbac715d1697e32358be0a0260555f0fe30839bd12f96d6dbbc22690da1d0f6222643803e940835cfafd8eb8db74c0339773b1038b12900dccbe6c5
|
7
|
+
data.tar.gz: 8db11420cb797c0d458ffaaf4f75e7a00ce907251bcbddf8934c96487b49af23c3e452e16e1bb15ec8c2f9ef4c55877abc787f83185c239e1299b4c7a20225f0
|
data/lib/dorian/git/tree.rb
CHANGED
@@ -4,7 +4,7 @@ module Dorian
|
|
4
4
|
module Git
|
5
5
|
class Tree
|
6
6
|
def self.run
|
7
|
-
list(ARGV.first ||
|
7
|
+
list(ARGV.first || '.')
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
@@ -12,17 +12,19 @@ module Dorian
|
|
12
12
|
def self.list(dir, start: true)
|
13
13
|
puts dir if start
|
14
14
|
|
15
|
-
`git ls-tree HEAD #{Shellwords.escape(dir)} --name-only`.split("\n")
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
`git ls-tree HEAD #{Shellwords.escape(dir)} --name-only`.split("\n")
|
16
|
+
.sort
|
17
|
+
.each do |line|
|
18
|
+
split = line.split('/')
|
19
|
+
puts format(line)
|
20
|
+
list(line + '/', start: false) if File.directory?(line)
|
21
|
+
end
|
20
22
|
end
|
21
23
|
|
22
24
|
def self.format(file)
|
23
25
|
split = file.split('/')
|
24
26
|
return file unless split.size > 1
|
25
|
-
|
27
|
+
'│ ' * (split.size - 2) + '└── ' + split.last
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
metadata
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorian-git-tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: |-
|
14
|
+
Lists your files and directories in your git repository as a tree
|
15
|
+
|
16
|
+
e.g. `git-tree config/`
|
14
17
|
email: dorian@dorianmarie.fr
|
15
18
|
executables:
|
16
19
|
- git-tree
|
@@ -38,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
41
|
- !ruby/object:Gem::Version
|
39
42
|
version: '0'
|
40
43
|
requirements: []
|
41
|
-
rubygems_version: 3.2.
|
44
|
+
rubygems_version: 3.2.22
|
42
45
|
signing_key:
|
43
46
|
specification_version: 4
|
44
47
|
summary: Lists your files and directories in your git repository as a tree
|