dorian-git-tree 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/git-tree +2 -1
  3. data/lib/dorian/git/tree.rb +11 -6
  4. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db9e5c485461690eb5d6c477b7ee19800310a7ed75cc344a75ce4e010a84f39a
4
- data.tar.gz: 2754c9fb19a4ea50b1caf7d456fac5407964d94f572e560b68d41bad4eb49a3c
3
+ metadata.gz: a4424818fad63e82abf652b7edcac3b59f695cf2a7b24dd0889a20a8e8f8064a
4
+ data.tar.gz: 0545b7c1e65dcca7df4272cc1110e12cbd1fa041bd9088b598c1284c33109559
5
5
  SHA512:
6
- metadata.gz: 5bf1564b380bb50e76d70772cc9d58a8bea580a57d7a15de717906a7da535f7a36d1398c4c5aa651a70f014ed37d8fc75a0542215e87dc6d81d9326025091604
7
- data.tar.gz: d4fdd7e69ed9f1c0802a6c7c83368d6937ae19321560b5ee9616c896a49573e98f28422b07076122803ef0fcc3752f360848e027dce502a30efbd91a727008d4
6
+ metadata.gz: 11f2811b994063ba6154af10e9aafd37e40c980d93ffb3934237f67f7bf0aa42b225e12d43f342979e640933ca404d1ffe7a662b84d057070dba7edb64ef4c29
7
+ data.tar.gz: 3f241d674d57ca35d64fcf1447d619f4dad69f7eca2f288eae9c7bbbac946f4ce2f77e731720dfc52b86ee42f7a923b19aa25c15e2a87f21292611c36a019470
data/bin/git-tree CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require 'dorian/git/tree'
4
+ require "dorian/git/tree"
4
5
  Dorian::Git::Tree.run
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "English"
4
+
1
5
  require "shellwords"
2
6
 
3
7
  module Dorian
@@ -16,9 +20,10 @@ module Dorian
16
20
 
17
21
  key = ARGV.first || "."
18
22
 
19
- files = git_ls_files(key).map do |file|
20
- ARGV.first ? file.sub(ARGV.first, "") : file
21
- end
23
+ files =
24
+ git_ls_files(key).map do |file|
25
+ ARGV.first ? file.sub(ARGV.first, "") : file
26
+ end
22
27
 
23
28
  values = group(files)
24
29
 
@@ -31,14 +36,14 @@ module Dorian
31
36
  key: value_key,
32
37
  values: value_values,
33
38
  index: value_index,
34
- size: values.size,
39
+ size: values.size
35
40
  )
36
41
  end
37
42
  end
38
43
 
39
44
  def self.git_ls_files(path)
40
45
  result = `#{["git", "ls-files", path].compact.shelljoin}`.split("\n")
41
- exit $?.exitstatus if $?.exitstatus > 0
46
+ exit $CHILD_STATUS.exitstatus if $CHILD_STATUS.exitstatus.positive?
42
47
  result
43
48
  end
44
49
 
@@ -48,7 +53,7 @@ module Dorian
48
53
  .transform_values do |values|
49
54
  group(
50
55
  values
51
- .map { |value| value.split("/")[1..-1].join("/") }
56
+ .map { |value| value.split("/")[1..].join("/") }
52
57
  .reject(&:empty?)
53
58
  )
54
59
  end
metadata CHANGED
@@ -1,20 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-git-tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.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-11-20 00:00:00.000000000 Z
11
+ date: 2024-03-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Lists your files and directories in your git repository as a tree
15
15
 
16
16
  e.g. `git-tree config/`
17
- email: dorian@dorianmarie.fr
17
+ email: dorian@dorianmarie.com
18
18
  executables:
19
19
  - git-tree
20
20
  extensions: []
@@ -22,7 +22,7 @@ extra_rdoc_files: []
22
22
  files:
23
23
  - bin/git-tree
24
24
  - lib/dorian/git/tree.rb
25
- homepage: https://github.com/dorianmariefr/git-tree
25
+ homepage: https://github.com/dorianmariecom/git-tree
26
26
  licenses:
27
27
  - MIT
28
28
  metadata:
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements: []
45
- rubygems_version: 3.2.22
45
+ rubygems_version: 3.5.3
46
46
  signing_key:
47
47
  specification_version: 4
48
48
  summary: Lists your files and directories in your git repository as a tree