colorls 1.5.1.pre.274 → 1.5.1.pre.276

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: d4ea2cc59c7de1371d6d4bf3fb69c53b82c383107c4da12e5a95809d54eb5834
4
- data.tar.gz: 63423b15bb8f31540f886871ef7b4ba4f0f2be869396f0a6869912cc63cf636b
3
+ metadata.gz: 2d95e56eb28ca5d8974477820fc782d64219fc47ca6820d66d80e37984caf7cb
4
+ data.tar.gz: 43d1cef5e4fe48019f427dcb83f95d6979127b1a6f8cc2643c4e57c2892a5c14
5
5
  SHA512:
6
- metadata.gz: a65f27cbe75ed71baa94125fb59f58add179f2b33524b8d7ee685498a63178fedf103a7de2b37b9088d23af247b4180a3c3a1783f3bc52f24dd6d2ee92930e68
7
- data.tar.gz: f06bd6e4736d2aa6220cd0c55a015e11e6cd4864933db4f9ce88b2e0fb59b2e7260f71b35baee1025c428270f73b69aca18e5d18e0d1f8c648a9e4fde7708391
6
+ metadata.gz: 1af313606d307b45e2ab507a02c15e46085ad5e30834ac20fac82e3d4bffdd3f5c89181fcff9aea294f96cc45c4c67262cf4ba99a6f6bd8bd99caf9f37248459
7
+ data.tar.gz: 1595b26e62b0909b435b9903fcce3786a53cd83adee89e8fb1bdf276585f55f20f81ee74d6dbcb5b9bafa4ce039c6fd736c98d3e4fb296d4e2ed45e3e18d6ef9
data/lib/colorls/core.rb CHANGED
@@ -407,6 +407,7 @@ module ColorLS
407
407
  when file.blockdev? then :blockdev
408
408
  when file.socket? then :socket
409
409
  when file.executable? then :executable_file
410
+ when file.hidden? then :hidden
410
411
  when @files.key?(key) then :recognized_file
411
412
  else :unrecognized_file
412
413
  end
@@ -415,20 +416,32 @@ module ColorLS
415
416
 
416
417
  def options(content)
417
418
  if content.directory?
418
- key = content.name.downcase.to_sym
419
- key = @folder_aliases[key] unless @folders.key? key
420
- key = :folder if key.nil?
421
- color = @colors[:dir]
422
- group = :folders
419
+ options_directory(content).values_at(:key, :color, :group)
423
420
  else
424
- key = File.extname(content.name).delete_prefix('.').downcase.to_sym
425
- key = @file_aliases[key] unless @files.key? key
426
- color = file_color(content, key)
427
- group = @files.key?(key) ? :recognized_files : :unrecognized_files
428
- key = :file if key.nil?
421
+ options_file(content).values_at(:key, :color, :group)
429
422
  end
423
+ end
424
+
425
+ def options_directory(content)
426
+ key = content.name.downcase.to_sym
427
+ key = @folder_aliases[key] unless @folders.key?(key)
428
+ key = :folder if key.nil?
429
+
430
+ color = content.hidden? ? @colors[:hidden_dir] : @colors[:dir]
431
+
432
+ {key: key, color: color, group: :folders}
433
+ end
434
+
435
+ def options_file(content)
436
+ key = File.extname(content.name).delete_prefix('.').downcase.to_sym
437
+ key = @file_aliases[key] unless @files.key?(key)
438
+
439
+ color = file_color(content, key)
440
+ group = @files.key?(key) ? :recognized_files : :unrecognized_files
441
+
442
+ key = :file if key.nil?
430
443
 
431
- [key, color, group]
444
+ {key: key, color: color, group: group}
432
445
  end
433
446
 
434
447
  def tree_contents(path)
@@ -40,6 +40,10 @@ module ColorLS
40
40
  @dead
41
41
  end
42
42
 
43
+ def hidden?
44
+ @name.start_with?('.')
45
+ end
46
+
43
47
  def owner
44
48
  return @@users[@stats.uid] if @@users.key? @stats.uid
45
49
 
@@ -9,9 +9,11 @@ dead_link: red
9
9
  link: cyan
10
10
 
11
11
  # special files
12
- socket: green
13
- blockdev: green
14
- chardev: green
12
+ socket: green
13
+ blockdev: green
14
+ chardev: green
15
+ hidden: burlywood
16
+ hidden_dir: slategray
15
17
 
16
18
  # Access Modes
17
19
  write: darkkhaki
@@ -9,9 +9,11 @@ dead_link: red
9
9
  link: cyan
10
10
 
11
11
  # special files
12
- socket: darkgray
13
- blockdev: darkgray
14
- chardev: darkgray
12
+ socket: darkgray
13
+ blockdev: darkgray
14
+ chardev: darkgray
15
+ hidden: seagreen
16
+ hidden_dir: royalblue
15
17
 
16
18
  # Access Modes
17
19
  write: red
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colorls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1.pre.274
4
+ version: 1.5.1.pre.276
5
5
  platform: ruby
6
6
  authors:
7
7
  - Athitya Kumar