treely 1.0.5 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/treely +5 -6
- data/lib/treely/tree.rb +2 -2
- data/lib/treely/version.rb +3 -0
- data/lib/treely.rb +1 -2
- metadata +12 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baa98bb08c38105f10e629aa7e34356746b27402ae29ad7c05d459d281457166
|
4
|
+
data.tar.gz: 627b9afaf8b6d6a12e35c82098f3a814a7313a3f659508000fc7036f9f334e96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 031f4612e1eae8d823182008c7be10de46e69c8e16d291e00313eb780970e5b86f81429f5d72f8deb2baae2fdbda635275ae2fa94770761c91bc3f44e94430cd
|
7
|
+
data.tar.gz: dbf8587b48b5d28d4d908e0956671ab70b6c399c564da5b5b375103f9a07ff357372d8104b764e38f013804e80dc7f62af773272224e6b89396d1f18e66f9505
|
data/bin/treely
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
2
|
require 'json'
|
4
3
|
require 'pathname'
|
5
4
|
|
@@ -16,15 +15,15 @@ Mercenary.program(:treely) do |program|
|
|
16
15
|
|
17
16
|
program.action do |args, options|
|
18
17
|
contents = if args[0].present?
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
Treely::Directory.new(args[0]).contents
|
19
|
+
else
|
20
|
+
JSON.parse(ARGF.read, symbolize_names: true)
|
21
|
+
end
|
23
22
|
|
24
23
|
if contents.any? { |item| item.has_key?(:files) }
|
25
24
|
puts Treely.tree(contents[0..-2])
|
26
25
|
puts %{}
|
27
|
-
puts
|
26
|
+
puts '%s %s, %s %s' % [
|
28
27
|
contents[-1].fetch(:directories),
|
29
28
|
%{directories}.pluralize(contents[-1][:directories]),
|
30
29
|
contents[-1].fetch(:files),
|
data/lib/treely/tree.rb
CHANGED
@@ -18,12 +18,12 @@ module Treely
|
|
18
18
|
@contents << @style[index.zero? ? :dot : :bar]
|
19
19
|
@contents << @style[:new_line]
|
20
20
|
@contents << args.map { |name| @style[name] }.join
|
21
|
-
@contents << @style[source[index
|
21
|
+
@contents << @style[source[index.next] ? :branch : :last_branch]
|
22
22
|
@contents << item.fetch(:name)
|
23
23
|
@contents << @style[:new_line]
|
24
24
|
|
25
25
|
if item.has_key?(:contents)
|
26
|
-
treely item[:contents], *args, (source[index
|
26
|
+
treely item[:contents], *args, (source[index.next] ? :bar : :indent)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
data/lib/treely.rb
CHANGED
metadata
CHANGED
@@ -1,59 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: treely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- razeos at tossdev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: minitest
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '5.11'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '5.11'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: activesupport
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
19
|
+
version: '6.0'
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '6.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: mercenary
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
33
|
+
version: 0.4.0
|
48
34
|
type: :runtime
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
40
|
+
version: 0.4.0
|
55
41
|
description:
|
56
|
-
email:
|
42
|
+
email:
|
57
43
|
executables:
|
58
44
|
- treely
|
59
45
|
extensions: []
|
@@ -64,7 +50,8 @@ files:
|
|
64
50
|
- lib/treely/configuration.rb
|
65
51
|
- lib/treely/directory.rb
|
66
52
|
- lib/treely/tree.rb
|
67
|
-
|
53
|
+
- lib/treely/version.rb
|
54
|
+
homepage: https://github.com/tualand/treely
|
68
55
|
licenses:
|
69
56
|
- MIT
|
70
57
|
metadata: {}
|
@@ -83,8 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
70
|
- !ruby/object:Gem::Version
|
84
71
|
version: '0'
|
85
72
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
73
|
+
rubygems_version: 3.1.2
|
87
74
|
signing_key:
|
88
75
|
specification_version: 4
|
89
|
-
summary: A
|
76
|
+
summary: A gem for generating tree-like format
|
90
77
|
test_files: []
|