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 +4 -4
- data/lib/colorls/core.rb +24 -11
- data/lib/colorls/fileinfo.rb +4 -0
- data/lib/yaml/dark_colors.yaml +5 -3
- data/lib/yaml/light_colors.yaml +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d95e56eb28ca5d8974477820fc782d64219fc47ca6820d66d80e37984caf7cb
|
4
|
+
data.tar.gz: 43d1cef5e4fe48019f427dcb83f95d6979127b1a6f8cc2643c4e57c2892a5c14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
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
|
-
|
444
|
+
{key: key, color: color, group: group}
|
432
445
|
end
|
433
446
|
|
434
447
|
def tree_contents(path)
|
data/lib/colorls/fileinfo.rb
CHANGED
data/lib/yaml/dark_colors.yaml
CHANGED
data/lib/yaml/light_colors.yaml
CHANGED
@@ -9,9 +9,11 @@ dead_link: red
|
|
9
9
|
link: cyan
|
10
10
|
|
11
11
|
# special files
|
12
|
-
socket:
|
13
|
-
blockdev:
|
14
|
-
chardev:
|
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
|