dorian-top 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/top +6 -5
- 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: 79229b911c817146536894a996c8fcd06ec5dfb9fe0076853f6237274968b596
|
4
|
+
data.tar.gz: '00691032225c23d31e1b7d875c97cac98c05a774cd60b14ae552294175dd5865'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89a8105eb8fd6652186c03d2c800e9adaf4d41513525823c6d87b4088795db99056c37f878ff2003a1c0ef8bf0180b9290e22414b608ecc940f22dec7df856c4
|
7
|
+
data.tar.gz: 333e2ea33edb9f4d55d73da2d125b861740f7127c8c9757c119af5f3d433857b104782fd4a8d4ff8d87a2a10e15b4ec75da6415d9a35daa6f5393ca356370979
|
data/bin/top
CHANGED
@@ -10,18 +10,19 @@ N = (ARGV.first || 10).to_i
|
|
10
10
|
SHELL = File.basename(ARGV.last || ENV["SHELL"] || "bash")
|
11
11
|
|
12
12
|
HISTORY =
|
13
|
-
|
13
|
+
case SHELL
|
14
|
+
when "fish"
|
14
15
|
File
|
15
16
|
.read("#{Dir.home}/.local/share/fish/fish_history")
|
16
17
|
.lines
|
17
18
|
.grep(/^- cmd: /)
|
18
19
|
.map { |line| line.split("- cmd: ", 2).last.strip }
|
19
|
-
|
20
|
+
when "bash"
|
20
21
|
File.read("#{Dir.home}/.bash_history").lines.map(&:strip)
|
21
|
-
|
22
|
+
when "zsh"
|
22
23
|
File.read("#{Dir.home}/.zsh_history").lines.map(&:strip)
|
23
24
|
else
|
24
|
-
raise NotImplementedError
|
25
|
+
raise NotImplementedError, SHELL
|
25
26
|
end
|
26
27
|
|
27
28
|
puts(
|
@@ -37,7 +38,7 @@ puts(
|
|
37
38
|
"#{index + 1}\t" \
|
38
39
|
"#{command_count}\t" \
|
39
40
|
"#{(command_count * 100 / HISTORY.size.to_f).round(3)}%\t" \
|
40
|
-
|
41
|
+
"#{command}"
|
41
42
|
end
|
42
43
|
.first(N)
|
43
44
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorian-top
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Lists the most used commands
|