colorls 1.2.1.pre.606 → 1.2.1.pre.613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/colorls/core.rb +17 -13
- 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: ca1363c7e1f385fc4effe36186a63c319d1c9cee648d00f91824a7eae280b36a
|
|
4
|
+
data.tar.gz: b28a5dc5053606ec1e969ac7a5565e3c8ce5faa2ee94e74b20a313ea054f1dbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7efd794bf0de142a9167150fc3b20b489e91127b0f8d2f760d3d747e090c58f2499b1473cd681fe64aeab16a34694cccf4ced2dbbb047ccf3e8e29329d80917c
|
|
7
|
+
data.tar.gz: d9cf7fb635e51c9dedb03f17c562a54b6e680c1af8124b06879719a4c2b06f877f6d86fb4520acb474577378c5c20e0a6574f121e10c10f6c0becd54bf67ecf9
|
data/lib/colorls/core.rb
CHANGED
|
@@ -93,10 +93,8 @@ module ColorLS
|
|
|
93
93
|
end
|
|
94
94
|
@total_content_length = @contents.length
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
init_column_lengths
|
|
97
97
|
|
|
98
|
-
init_user_lengths
|
|
99
|
-
init_group_lengths
|
|
100
98
|
@contents
|
|
101
99
|
end
|
|
102
100
|
|
|
@@ -105,16 +103,20 @@ module ColorLS
|
|
|
105
103
|
@contents.keep_if { |x| !x.start_with? '.' } unless @all || @almost_all
|
|
106
104
|
end
|
|
107
105
|
|
|
108
|
-
def
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
end
|
|
106
|
+
def init_column_lengths
|
|
107
|
+
return unless @long
|
|
108
|
+
|
|
109
|
+
maxlink = maxuser = maxgroup = 0
|
|
113
110
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
c.
|
|
117
|
-
|
|
111
|
+
@contents.each do |c|
|
|
112
|
+
maxlink = c.nlink if c.nlink > maxlink
|
|
113
|
+
maxuser = c.owner.length if c.owner.length > maxuser
|
|
114
|
+
maxgroup = c.group.length if c.group.length > maxgroup
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
@linklength = maxlink.digits.length
|
|
118
|
+
@userlength = maxuser
|
|
119
|
+
@grouplength = maxgroup
|
|
118
120
|
end
|
|
119
121
|
|
|
120
122
|
def filter_contents
|
|
@@ -257,7 +259,9 @@ module ColorLS
|
|
|
257
259
|
def long_info(content)
|
|
258
260
|
return '' unless @long
|
|
259
261
|
|
|
260
|
-
|
|
262
|
+
links = content.nlink.to_s.rjust(@linklength)
|
|
263
|
+
|
|
264
|
+
[mode_info(content.stats), links, user_info(content), group_info(content.group),
|
|
261
265
|
size_info(content.size), mtime_info(content.mtime)].join(' ')
|
|
262
266
|
end
|
|
263
267
|
|
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.2.1.pre.
|
|
4
|
+
version: 1.2.1.pre.613
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Athitya Kumar
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-07-
|
|
11
|
+
date: 2019-07-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: clocale
|