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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dorian/git/tree.rb +9 -7
  3. metadata +7 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7941d3c1e774c7016afbcd7312e898c8eded0ad1b4351f1d41b19f81dc050e93
4
- data.tar.gz: 0e6f97dd4794c2a99178d4a8c0199da2d6344fd5a9799a9deabc4293e54ccf46
3
+ metadata.gz: fb002166fb2e78caa5668ba160022eb5765d2d372ab811fff3041164d8726d7e
4
+ data.tar.gz: 1ee4d98c0b4c7aae9ea5bc26caa60deb0f53bd5ed48f032a6053eec2691c1bbe
5
5
  SHA512:
6
- metadata.gz: ca8d56279c9344544e0b8da407ce8c9d593ffa9a0feffa16d0aa2d03bb06bb8d5717c10f04c34910740b15abdaf3f56fc4bb81d123c0510eb43f5cf1e05a6be7
7
- data.tar.gz: 5acf0492a1bc1eee0fc957c58f9013da8dcf227d90043d369aa732e247c487b9a430c45954b6169095fa61c2e08392523582ff32b4991238c21e83a3472ac735
6
+ metadata.gz: f308c7395bbac715d1697e32358be0a0260555f0fe30839bd12f96d6dbbc22690da1d0f6222643803e940835cfafd8eb8db74c0339773b1038b12900dccbe6c5
7
+ data.tar.gz: 8db11420cb797c0d458ffaaf4f75e7a00ce907251bcbddf8934c96487b49af23c3e452e16e1bb15ec8c2f9ef4c55877abc787f83185c239e1299b4c7a20225f0
@@ -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").sort.each do |line|
16
- split = line.split('/')
17
- puts format(line)
18
- list(line + '/', start: false) if File.directory?(line)
19
- end
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
- "" * (split.size - 2) + "└── " + split.last
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.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-08 00:00:00.000000000 Z
11
+ date: 2021-10-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: e.g. `git-tree config/`
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.19
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