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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7162556fbfe395a7ae76f013d9ef08b8da6c003909474d5957a93379bf4a7611
4
- data.tar.gz: c207077e85b382806a159092e33fcde66b1e4b32f2158d1250ad95e3d3488495
3
+ metadata.gz: 9f89d76a473546be1e5dbb6f7840fd1bb3f06c211964bfe95e4f69c56b1f5bb4
4
+ data.tar.gz: bcce18c801fc5e0d30dc6aa15c074d1fa5e2ef7c67c3f664bdd167e3e8f56794
5
5
  SHA512:
6
- metadata.gz: d913ca8efbfeca20a7c07e7d9a7fe339572e4fa5c67fd3f3f3f7d0645ef5a8b96fdadf961206adf9a64f622db7ff533ad555aaf7be2dbc2ea113acacec7d2793
7
- data.tar.gz: b762b55040311721b08dd7917b96b9a3b78775d3880d78d401d7381da16637c050b770cb216797c435d5c023d01101ee5fb189e405ab095b4c9a7de766087d8d
6
+ metadata.gz: 9f37f5f2500a0dacff8422ff080266ca282567be77aad186d760a49b44227bf6f80dcf07c962bb2b33c2cb1d763b9601deb2ebe4671dbd7e0780c954985be0e9
7
+ data.tar.gz: 98e65d585aa4d6f83dabd6fbb35f73cfd5d21b38726b05acf024cb891fef5831d5d16f10538f9269624c1448b2eeeaf78b28803aa13af4b953af6489f9dd92e8
@@ -270,7 +270,8 @@ module ColorLS
270
270
  def symlink_info(content)
271
271
  return '' unless @long && content.symlink?
272
272
 
273
- link_info = " #{content.link_target}"
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
@@ -16,10 +16,7 @@ module ColorLS
16
16
  @name = File.basename(path)
17
17
  @stats = File.lstat(path)
18
18
 
19
- return unless link_info && @stats.symlink?
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.647
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-29 00:00:00.000000000 Z
11
+ date: 2020-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clocale