colorls 1.3.3.pre.647 → 1.3.3.pre.649
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/colorls/core.rb +2 -1
- data/lib/colorls/fileinfo.rb +10 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f89d76a473546be1e5dbb6f7840fd1bb3f06c211964bfe95e4f69c56b1f5bb4
|
4
|
+
data.tar.gz: bcce18c801fc5e0d30dc6aa15c074d1fa5e2ef7c67c3f664bdd167e3e8f56794
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f37f5f2500a0dacff8422ff080266ca282567be77aad186d760a49b44227bf6f80dcf07c962bb2b33c2cb1d763b9601deb2ebe4671dbd7e0780c954985be0e9
|
7
|
+
data.tar.gz: 98e65d585aa4d6f83dabd6fbb35f73cfd5d21b38726b05acf024cb891fef5831d5d16f10538f9269624c1448b2eeeaf78b28803aa13af4b953af6489f9dd92e8
|
data/lib/colorls/core.rb
CHANGED
@@ -270,7 +270,8 @@ module ColorLS
|
|
270
270
|
def symlink_info(content)
|
271
271
|
return '' unless @long && content.symlink?
|
272
272
|
|
273
|
-
|
273
|
+
target = content.link_target.nil? ? '…' : content.link_target
|
274
|
+
link_info = " ⇒ #{target}"
|
274
275
|
if content.dead?
|
275
276
|
"#{link_info} [Dead link]".colorize(@colors[:dead_link])
|
276
277
|
else
|
data/lib/colorls/fileinfo.rb
CHANGED
@@ -16,10 +16,7 @@ module ColorLS
|
|
16
16
|
@name = File.basename(path)
|
17
17
|
@stats = File.lstat(path)
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
@dead = !File.exist?(path)
|
22
|
-
@target = File.readlink(path)
|
19
|
+
handle_symlink(path) if link_info && @stats.symlink?
|
23
20
|
end
|
24
21
|
|
25
22
|
def self.info(path)
|
@@ -58,5 +55,14 @@ module ColorLS
|
|
58
55
|
end
|
59
56
|
|
60
57
|
def_delegators :@stats, :directory?, :socket?, :chardev?, :symlink?, :blockdev?, :mtime, :nlink, :size, :owned?
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def handle_symlink(path)
|
62
|
+
@target = File.readlink(path)
|
63
|
+
@dead = !File.exist?(path)
|
64
|
+
rescue SystemCallError => e
|
65
|
+
STDERR.puts "cannot read symbolic link: #{e}"
|
66
|
+
end
|
61
67
|
end
|
62
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colorls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.3.pre.
|
4
|
+
version: 1.3.3.pre.649
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Athitya Kumar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clocale
|