tty-tree 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/tty/tree/directory_renderer.rb +0 -1
- data/lib/tty/tree/node.rb +7 -1
- data/lib/tty/tree/version.rb +1 -1
- data/spec/unit/node_spec.rb +7 -1
- data/tty-tree.gemspec +3 -3
- metadata +12 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53809e6a714d9396dad1142a2a2b9a0183c7cc18580634ea3d9e0e42a22fb58a
|
4
|
+
data.tar.gz: 14326bab7fc703fb8e39870238f9a4ff964c9ab60699d2a18bf4c42a381abe88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a4a9598b9b71c63eb8332b6445686b553aba1e6af92937dc23a0f3432f5ae67190bd91985975bba95afe18bf70dd89e58001f5c2875c4dd4b35790ec38933e6
|
7
|
+
data.tar.gz: 27dafaa5422382d8749017825110641ea4021c71a3778997a6484804015d08b217eaec6941e834a448fc9d25e07ea4f3e2d94735e0bcbf9367b93e37f4459e64
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.3.0] - 2019-05-03
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Strip null bytes from pathname by Stephen A. Wilson(@Zeragamba)
|
7
|
+
|
3
8
|
## [v0.2.0] - 2018-09-01
|
4
9
|
|
5
10
|
### Changed
|
@@ -9,5 +14,6 @@
|
|
9
14
|
|
10
15
|
* Initial implementation and release
|
11
16
|
|
17
|
+
[v0.3.0]: https://github.com/piotrmurach/tty-tree/compare/v0.2.0...v0.3.0
|
12
18
|
[v0.2.0]: https://github.com/piotrmurach/tty-tree/compare/v0.1.0...v0.2.0
|
13
19
|
[v0.1.0]: https://github.com/piotrmurach/tty-tree/compare/v0.1.0
|
data/README.md
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
> Print directory or structured data in a tree like format.
|
23
23
|
|
24
|
-
**TTY::
|
24
|
+
**TTY::Tree** provides independent directory or hash data rendering component for [TTY](https://github.com/piotrmurach/tty) toolkit.
|
25
25
|
|
26
26
|
## Installation
|
27
27
|
|
data/lib/tty/tree/node.rb
CHANGED
@@ -33,7 +33,12 @@ module TTY
|
|
33
33
|
:symlink?, :socket?, :pipe?
|
34
34
|
|
35
35
|
def initialize(path, parent, prefix, level)
|
36
|
-
|
36
|
+
if path.is_a? String
|
37
|
+
# strip null bytes from the string to avoid throwing errors
|
38
|
+
path = path.delete("\0")
|
39
|
+
end
|
40
|
+
|
41
|
+
@path = Pathname.new(path)
|
37
42
|
@name = @path.basename
|
38
43
|
@parent = Pathname.new(parent)
|
39
44
|
@prefix = prefix
|
@@ -42,6 +47,7 @@ module TTY
|
|
42
47
|
|
43
48
|
def full_path
|
44
49
|
return parent if name.to_s.empty?
|
50
|
+
|
45
51
|
parent.join(name)
|
46
52
|
end
|
47
53
|
|
data/lib/tty/tree/version.rb
CHANGED
data/spec/unit/node_spec.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
RSpec.describe TTY::Tree::Node do
|
5
5
|
it "provides directory stats" do
|
6
6
|
dir = fixtures_path('dir1')
|
7
|
-
node = TTY::Tree::Node.new(dir, '', '',
|
7
|
+
node = TTY::Tree::Node.new(dir, '', '', 0)
|
8
8
|
|
9
9
|
expect(node.directory?).to eq(true)
|
10
10
|
expect(node.file?).to eq(false)
|
@@ -33,4 +33,10 @@ RSpec.describe TTY::Tree::Node do
|
|
33
33
|
|
34
34
|
expect(node_a).to_not eq(node_b)
|
35
35
|
end
|
36
|
+
|
37
|
+
it "strips null bytes from pathname" do
|
38
|
+
node = nil
|
39
|
+
expect {node = TTY::Tree::Node.new("dir1\0", '', '', 0)}.not_to raise_error
|
40
|
+
expect(node.path.to_s).to eq('dir1')
|
41
|
+
end
|
36
42
|
end
|
data/tty-tree.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "tty-tree"
|
7
7
|
spec.version = TTY::Tree::VERSION
|
8
8
|
spec.authors = ["Piotr Murach"]
|
9
|
-
spec.email = [""]
|
9
|
+
spec.email = ["me@piotrmurach.com"]
|
10
10
|
|
11
11
|
spec.summary = %q{Print directory or structured data in a tree like format.}
|
12
12
|
spec.description = %q{Print directory or structured data in a tree like format.}
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.required_ruby_version = '>= 2.0.0'
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler", "
|
25
|
-
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "bundler", ">= 1.14.0"
|
25
|
+
spec.add_development_dependency "rake"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
27
27
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.14.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.14.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '3.0'
|
55
55
|
description: Print directory or structured data in a tree like format.
|
56
56
|
email:
|
57
|
-
-
|
57
|
+
- me@piotrmurach.com
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
@@ -103,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
|
107
|
-
rubygems_version: 2.7.3
|
106
|
+
rubygems_version: 3.0.3
|
108
107
|
signing_key:
|
109
108
|
specification_version: 4
|
110
109
|
summary: Print directory or structured data in a tree like format.
|