colorls 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/colorls.gemspec +1 -3
- data/lib/colorls.rb +2 -2
- data/lib/colorls/core.rb +12 -10
- data/lib/colorls/monkeys.rb +5 -0
- data/lib/colorls/version.rb +1 -1
- data/lib/yaml/dark_colors.yaml +22 -15
- data/lib/yaml/light_colors.yaml +18 -11
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2143c29f56d6774467dd21e00da5c06da164577a
|
4
|
+
data.tar.gz: 3ab917069cd931533bf49d2fb75e1572393d80fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb34aaca78b664cc5d9dbd08c75808925c71c28f5be8b98f7bdd7f938001a59f0a6397c7b896980993cf06d6b0d85ee7635dd0ca7aa9dcbd073419b98a64f13a
|
7
|
+
data.tar.gz: 2f1abe88cff446da70966ddaa1f09c31e2d3ae7bb5156a0ca72f30ec9605e52f6d9870d22e50824840436c61cb9e1c6720a0de43359124957b82368612393ed2
|
data/colorls.gemspec
CHANGED
@@ -17,7 +17,6 @@ ColorLS::POST_INSTALL_MESSAGE = %(
|
|
17
17
|
*******************************************************************
|
18
18
|
).freeze
|
19
19
|
|
20
|
-
# rubocop:disable Metrics/BlockLength
|
21
20
|
Gem::Specification.new do |spec|
|
22
21
|
spec.name = 'colorls'
|
23
22
|
spec.version = ColorLS::VERSION
|
@@ -36,11 +35,10 @@ Gem::Specification.new do |spec|
|
|
36
35
|
|
37
36
|
spec.post_install_message = ColorLS::POST_INSTALL_MESSAGE
|
38
37
|
|
39
|
-
spec.add_runtime_dependency 'colorize'
|
40
38
|
spec.add_runtime_dependency 'facets'
|
41
39
|
spec.add_runtime_dependency 'filesize'
|
42
40
|
spec.add_runtime_dependency 'git'
|
43
|
-
spec.add_runtime_dependency '
|
41
|
+
spec.add_runtime_dependency 'rainbow'
|
44
42
|
|
45
43
|
spec.add_development_dependency 'bundler', '~> 1.15'
|
46
44
|
spec.add_development_dependency 'diffy'
|
data/lib/colorls.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'colorize'
|
2
1
|
require 'yaml'
|
3
2
|
require 'facets'
|
4
|
-
require 'terminfo'
|
5
3
|
require 'etc'
|
6
4
|
require 'filesize'
|
7
5
|
require 'git'
|
6
|
+
require 'rainbow/ext/string'
|
8
7
|
|
9
8
|
require 'colorls/core'
|
10
9
|
require 'colorls/flags'
|
11
10
|
require 'colorls/load_from_yaml'
|
11
|
+
require 'colorls/monkeys'
|
data/lib/colorls/core.rb
CHANGED
@@ -13,7 +13,7 @@ module ColorLS
|
|
13
13
|
@long = long
|
14
14
|
@tree = tree
|
15
15
|
@git_status = git_status
|
16
|
-
@screen_width =
|
16
|
+
@screen_width = `tput cols`.chomp.to_i
|
17
17
|
@colors = colors
|
18
18
|
|
19
19
|
@contents = init_contents(@input)
|
@@ -227,21 +227,23 @@ module ColorLS
|
|
227
227
|
relative_path = relative_path==path ? '' : relative_path+'/'
|
228
228
|
|
229
229
|
status = Git.open('.').status
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
230
|
+
git_info_of_file("#{relative_path}#{content}", status)
|
231
|
+
end
|
232
|
+
|
233
|
+
def git_info_of_file(path, status)
|
234
|
+
return '(A)'.colorize(@colors[:added]) if status.added.keys.any? { |a| a.include?(path) }
|
235
|
+
return '(?)'.colorize(@colors[:untracked]) if status.untracked.keys.any? { |u| u.include?(path) }
|
236
|
+
return '(C)'.colorize(@colors[:changed]) if status.changed.keys.any? { |c| c.include?(path) }
|
237
|
+
' '.colorize(@colors[:unchanged])
|
234
238
|
end
|
235
239
|
|
236
240
|
def long_info(path, content)
|
237
241
|
return '' unless @long
|
238
|
-
@git_status = true
|
239
242
|
unless File.exist?("#{path}/#{content}")
|
240
|
-
return '[No Info]'.colorize(@colors[:error]) + ' ' * (
|
243
|
+
return '[No Info]'.colorize(@colors[:error]) + ' ' * (38 + @userlength + @grouplength)
|
241
244
|
end
|
242
245
|
stat = File.stat("#{path}/#{content}")
|
243
|
-
|
244
|
-
[mode_info(stat), user_info(stat), group_info(stat), size_info(stat), mtime_info(stat),git_info(path,content)]
|
246
|
+
[mode_info(stat), user_info(stat), group_info(stat), size_info(stat), mtime_info(stat)]
|
245
247
|
.join(' ')
|
246
248
|
end
|
247
249
|
|
@@ -265,7 +267,7 @@ module ColorLS
|
|
265
267
|
|
266
268
|
[
|
267
269
|
long_info(path, content),
|
268
|
-
"#{git_info(path,content)} ",
|
270
|
+
" #{git_info(path,content)} ",
|
269
271
|
logo.colorize(color),
|
270
272
|
" #{content.colorize(color)}#{slash?(path, content)}#{symlink_info(path, content)}"
|
271
273
|
].join
|
data/lib/colorls/version.rb
CHANGED
data/lib/yaml/dark_colors.yaml
CHANGED
@@ -1,31 +1,38 @@
|
|
1
1
|
# Main Colors
|
2
|
-
unrecognized_file:
|
3
|
-
recognized_file:
|
4
|
-
dir:
|
2
|
+
unrecognized_file: gold
|
3
|
+
recognized_file: lime
|
4
|
+
dir: dodgerblue
|
5
5
|
|
6
6
|
# Link
|
7
7
|
dead_link: red
|
8
8
|
link: cyan
|
9
9
|
|
10
10
|
# Access Modes
|
11
|
-
write:
|
12
|
-
read:
|
13
|
-
exec:
|
14
|
-
no_access:
|
11
|
+
write: darkkhaki
|
12
|
+
read: limegreen
|
13
|
+
exec: red
|
14
|
+
no_access: indianred
|
15
15
|
|
16
16
|
# Age
|
17
|
-
day_old:
|
18
|
-
hour_old:
|
19
|
-
no_modifier:
|
17
|
+
day_old: mediumspringgreen
|
18
|
+
hour_old: lime
|
19
|
+
no_modifier: seagreen
|
20
20
|
|
21
21
|
# File Size
|
22
|
-
file_large:
|
23
|
-
file_medium:
|
24
|
-
file_small:
|
22
|
+
file_large: orange
|
23
|
+
file_medium: gold
|
24
|
+
file_small: peachpuff
|
25
25
|
|
26
26
|
# Random
|
27
27
|
report: white
|
28
|
-
user:
|
28
|
+
user: moccasin
|
29
29
|
tree: cyan
|
30
30
|
empty: yellow
|
31
|
-
|
31
|
+
error: red
|
32
|
+
normal: darkkhaki
|
33
|
+
|
34
|
+
# Git
|
35
|
+
unchanged: forestgreen
|
36
|
+
added: chartreuse
|
37
|
+
changed: darkorange
|
38
|
+
untracked: darkred
|
data/lib/yaml/light_colors.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Main Colors
|
2
|
-
unrecognized_file:
|
3
|
-
recognized_file:
|
4
|
-
dir:
|
2
|
+
unrecognized_file: darkred
|
3
|
+
recognized_file: darkgreen
|
4
|
+
dir: navyblue
|
5
5
|
|
6
6
|
# Link
|
7
7
|
dead_link: red
|
@@ -9,23 +9,30 @@ link: cyan
|
|
9
9
|
|
10
10
|
# Access Modes
|
11
11
|
write: red
|
12
|
-
read:
|
13
|
-
exec:
|
12
|
+
read: sienna
|
13
|
+
exec: navyblue
|
14
14
|
no_access: black
|
15
15
|
|
16
16
|
# Age
|
17
|
-
day_old:
|
18
|
-
hour_old:
|
17
|
+
day_old: darkred
|
18
|
+
hour_old: saddlebrown
|
19
19
|
no_modifier: black
|
20
20
|
|
21
21
|
# File Size
|
22
|
-
file_large:
|
23
|
-
file_medium:
|
24
|
-
file_small:
|
22
|
+
file_large: darkred
|
23
|
+
file_medium: saddlebrown
|
24
|
+
file_small: black
|
25
25
|
|
26
26
|
# Random
|
27
27
|
report: black
|
28
|
-
user:
|
28
|
+
user: darkblue
|
29
29
|
tree: cyan
|
30
30
|
empty: yellow
|
31
|
+
error: red
|
31
32
|
normal: black
|
33
|
+
|
34
|
+
# Git
|
35
|
+
unchanged: darkgreen
|
36
|
+
added: saddlebrown
|
37
|
+
changed: saddlebrown
|
38
|
+
untracked: darkred
|
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.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Athitya Kumar
|
@@ -10,20 +10,6 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: colorize
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: facets
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +53,7 @@ dependencies:
|
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
56
|
+
name: rainbow
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
59
|
- - ">="
|
@@ -205,6 +191,7 @@ files:
|
|
205
191
|
- lib/colorls/core.rb
|
206
192
|
- lib/colorls/flags.rb
|
207
193
|
- lib/colorls/load_from_yaml.rb
|
194
|
+
- lib/colorls/monkeys.rb
|
208
195
|
- lib/colorls/version.rb
|
209
196
|
- lib/tab_complete.sh
|
210
197
|
- lib/yaml/dark_colors.yaml
|