colorls 1.5.1.pre.274 → 1.5.1.pre.287

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: ac10e5fa19e15528dbce5239ed5d2eb1de98d904b0f162c3b1732a5db4afd9ca
4
+ data.tar.gz: db991724b4c501f0139a5fa7cee35a8124a08dccbc223a4d6138130f638535c1
5
5
  SHA512:
6
- metadata.gz: a65f27cbe75ed71baa94125fb59f58add179f2b33524b8d7ee685498a63178fedf103a7de2b37b9088d23af247b4180a3c3a1783f3bc52f24dd6d2ee92930e68
7
- data.tar.gz: f06bd6e4736d2aa6220cd0c55a015e11e6cd4864933db4f9ce88b2e0fb59b2e7260f71b35baee1025c428270f73b69aca18e5d18e0d1f8c648a9e4fde7708391
6
+ metadata.gz: 58153d3235d491d67f773e6e1589024cbc0f78cf24e90cc60039ec245b35b126d8cd6f74ac8ef43833abd81e4dd5d70546c883e2c92869c09c1e79098f1e7afe
7
+ data.tar.gz: 51f2d4f4ebd9cdd3fbfe021aed0fa56c9e762ef72de6af3bf0e94b6681e78942fe9cbb60b46e7a77edd830639e39a81a5d9dd3104c59ed377c9b414de0a44731
data/colorls.gemspec CHANGED
@@ -72,7 +72,7 @@ Gem::Specification.new do |spec|
72
72
  spec.add_development_dependency 'diffy', '3.4.2'
73
73
  spec.add_development_dependency 'rake', '~> 13'
74
74
  spec.add_development_dependency 'rdoc', '~> 6.1'
75
- spec.add_development_dependency 'ronn', '~> 0'
75
+ spec.add_development_dependency 'ronn-ng', '~> 0'
76
76
  spec.add_development_dependency 'rspec', '~> 3.7'
77
77
  spec.add_development_dependency 'rspec-its', '~> 1.2'
78
78
  spec.add_development_dependency 'rubocop', '~> 1.50.1'
data/lib/colorls/core.rb CHANGED
@@ -260,7 +260,7 @@ module ColorLS
260
260
 
261
261
  def size_info(filesize)
262
262
  filesize = Filesize.new(filesize)
263
- size = @show_human_readable_size ? filesize.pretty : filesize.to_s
263
+ size = @show_human_readable_size ? filesize.pretty(precision: 0) : filesize.to_s('B', precision: 0)
264
264
  size = size.split
265
265
  size = justify_size_info(size)
266
266
  return size.colorize(@colors[:file_large]) if filesize >= 512 * (1024 ** 2)
@@ -280,7 +280,7 @@ module ColorLS
280
280
  end
281
281
 
282
282
  def justify_size_info(size)
283
- size_num = size[0][0..-4].rjust(chars_for_size, ' ')
283
+ size_num = size[0].rjust(chars_for_size, ' ')
284
284
  size_unit = @show_human_readable_size ? size[1].ljust(3, ' ') : size[1]
285
285
  "#{size_num} #{size_unit}"
286
286
  end
@@ -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
@@ -39,6 +39,7 @@ svg: image
39
39
  tiff: image
40
40
  webp: image
41
41
  jar: java
42
+ mjs: js
42
43
  properties: json
43
44
  tsx: jsx
44
45
  license: md
@@ -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
data/man/colorls.1 CHANGED
@@ -1,207 +1,144 @@
1
- .\" generated with Ronn/v0.7.3
2
- .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
- .
4
- .TH "COLORLS" "1" "July 2024" "colorls 1.5.0" "colorls Manual"
5
- .
1
+ .\" generated with Ronn-NG/v0.10.1
2
+ .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3
+ .TH "COLORLS" "1" "September 2024" "colorls 1.5.0" "colorls Manual"
6
4
  .SH "NAME"
7
5
  \fBcolorls\fR \- list directory contents with colors and icons
8
- .
9
6
  .SH "SYNOPSIS"
10
- \fBcolorls\fR [OPTION]\.\.\. [FILE]\.\.\.
11
- .
7
+ \fBcolorls\fR [OPTION]\|\.\|\.\|\. [FILE]\|\.\|\.\|\.
12
8
  .br
13
- .
14
9
  .SH "DESCRIPTION"
15
10
  List information about the given FILEs\. Uses different colors and icons for known file types\.
16
- .
17
11
  .P
18
12
  By default, the output is sorted alphabetically\.
19
- .
20
13
  .P
21
14
  Mandatory arguments to long options are mandatory for short options too\.
22
- .
23
15
  .SH "OPTIONS"
24
- .
25
16
  .TP
26
17
  \fB\-a\fR, \fB\-\-all\fR
27
18
  do not ignore entries starting with \.
28
- .
29
19
  .TP
30
20
  \fB\-A\fR, \fB\-\-almost\-all\fR
31
21
  do not list \. and \.\.
32
- .
33
22
  .TP
34
23
  \fB\-d\fR, \fB\-\-dirs\fR
35
24
  show only directories
36
- .
37
25
  .TP
38
26
  \fB\-f\fR, \fB\-\-files\fR
39
27
  show only files
40
- .
41
28
  .TP
42
29
  \fB\-\-gs\fR, \fB\-\-git\-status\fR
43
30
  show git status for each file
44
- .
45
31
  .TP
46
32
  \fB\-p\fR
47
33
  append / indicator to directories
48
- .
49
34
  .TP
50
35
  \fB\-i\fR, \fB\-\-inode\fR
51
36
  show inode number
52
- .
53
37
  .TP
54
38
  \fB\-\-report\fR
55
39
  show report: short, long (default if omitted)
56
- .
57
40
  .TP
58
41
  \fB\-\-indicator\-style\fR
59
42
  append indicator with style STYLE to entry names: none, slash (\-p) (default)
60
- .
61
43
  .TP
62
44
  \fB\-\-format\fR
63
45
  use format: across (\-x), horizontal (\-x), long (\-l), single\-column (\-1), vertical (\-C)
64
- .
65
46
  .TP
66
47
  \fB\-1\fR
67
48
  list one file per line
68
- .
69
49
  .TP
70
50
  \fB\-\-tree\fR
71
51
  shows tree view of the directory
72
- .
73
52
  .TP
74
53
  \fB\-x\fR
75
54
  list entries by lines instead of by columns
76
- .
77
55
  .TP
78
56
  \fB\-C\fR
79
57
  list entries by columns instead of by lines
80
- .
81
58
  .TP
82
59
  \fB\-\-without\-icons\fR
83
60
  list entries without icons
84
- .
85
61
  .TP
86
62
  \fB\-l\fR, \fB\-\-long\fR
87
63
  use a long listing format
88
- .
89
64
  .TP
90
65
  \fB\-o\fR
91
66
  use a long listing format without group information
92
- .
93
67
  .TP
94
68
  \fB\-g\fR
95
69
  use a long listing format without owner information
96
- .
97
70
  .TP
98
71
  \fB\-G\fR, \fB\-\-no\-group\fR
99
72
  show no group information in a long listing
100
- .
101
73
  .TP
102
74
  \fB\-\-time\-style\fR
103
75
  use time display format
104
- .
105
76
  .TP
106
77
  \fB\-\-no\-hardlinks\fR
107
78
  show no hard links count in a long listing
108
- .
109
79
  .TP
110
80
  \fB\-L\fR
111
81
  show information on the destination of symbolic links
112
- .
113
82
  .TP
114
83
  \fB\-\-non\-human\-readable\fR
115
84
  show file sizes in bytes only
116
- .
117
85
  .TP
118
86
  \fB\-\-sd\fR, \fB\-\-sort\-dirs\fR, \fB\-\-group\-directories\-first\fR
119
87
  sort directories first
120
- .
121
88
  .TP
122
89
  \fB\-\-sf\fR, \fB\-\-sort\-files\fR
123
90
  sort files first
124
- .
125
91
  .TP
126
92
  \fB\-t\fR
127
93
  sort by modification time, newest first
128
- .
129
94
  .TP
130
95
  \fB\-U\fR
131
96
  do not sort; list entries in directory order
132
- .
133
97
  .TP
134
98
  \fB\-S\fR
135
99
  sort by file size, largest first
136
- .
137
100
  .TP
138
101
  \fB\-X\fR
139
102
  sort by file extension
140
- .
141
103
  .TP
142
104
  \fB\-\-sort\fR
143
105
  sort by WORD instead of name: none, size (\-S), time (\-t), extension (\-X)
144
- .
145
106
  .TP
146
107
  \fB\-r\fR, \fB\-\-reverse\fR
147
108
  reverse order while sorting
148
- .
149
109
  .TP
150
110
  \fB\-h\fR, \fB\-\-human\-readable\fR:
151
111
 
152
- .
153
112
  .TP
154
113
  \fB\-\-color\fR
155
114
  colorize the output: auto, always (default if omitted), never
156
- .
157
115
  .TP
158
116
  \fB\-\-light\fR
159
117
  use light color scheme
160
- .
161
118
  .TP
162
119
  \fB\-\-dark\fR
163
120
  use dark color scheme
164
- .
165
121
  .TP
166
122
  \fB\-\-hyperlink\fR:
167
123
 
168
- .
169
124
  .TP
170
125
  \fB\-\-help\fR
171
126
  prints this help
172
- .
173
127
  .TP
174
128
  \fB\-\-version\fR
175
129
  show version
176
- .
177
130
  .SH "EXAMPLES"
178
- .
179
131
  .TP
180
132
  show the given file:
181
- .
182
- .IP
183
- \fBcolorls README\.md\fR
184
- .
133
+
185
134
  .TP
186
135
  show matching files and list matching directories:
187
- .
188
- .IP
189
- \fBcolorls *\fR
190
- .
136
+
191
137
  .TP
192
138
  filter output by a regular expression:
193
- .
194
- .IP
195
- \fBcolorls | grep PATTERN\fR
196
- .
139
+
197
140
  .TP
198
141
  several short options can be combined:
199
- .
200
- .IP
201
- \fBcolorls \-d \-l \-a\fR
202
- .
203
- .br
204
- \fBcolorls \-dla\fR
205
- .
142
+
206
143
  .SH "AUTHOR"
207
144
  Written by Athitya Kumar\.
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.5.1.pre.274
4
+ version: 1.5.1.pre.287
5
5
  platform: ruby
6
6
  authors:
7
7
  - Athitya Kumar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-12 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -177,7 +177,7 @@ dependencies:
177
177
  - !ruby/object:Gem::Version
178
178
  version: '6.1'
179
179
  - !ruby/object:Gem::Dependency
180
- name: ronn
180
+ name: ronn-ng
181
181
  requirement: !ruby/object:Gem::Requirement
182
182
  requirements:
183
183
  - - "~>"