dorian-top 0.2.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/top +29 -9
- 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: 7fcf8105bc630b9c030a57cfbc950cd0858789ea42a1a46172a17c91699f8948
|
4
|
+
data.tar.gz: 6b487c3639faebcb782b1ee660f0ebe4eba50c413fa7bba1c83413ed526a7b3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af8d343a95eef1e202bde9ab73b965ab2f66d13aef892d936d1349fe44a714e3bdc1d71d7656327774b97f036481f2fb776e787290361739639efa74342d1c0b
|
7
|
+
data.tar.gz: beb27edf337c5873d03040e86bad71be8026d83e270b42e034d979307a2518d233a77678c4e7fbff2a43c472f5e137013b312b033f7958c649faa582149b24cd
|
data/bin/top
CHANGED
@@ -1,16 +1,36 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
require "dorian/arguments"
|
5
|
+
|
6
|
+
parsed =
|
7
|
+
Dorian::Arguments.parse(
|
8
|
+
limit: {
|
9
|
+
type: :integer,
|
10
|
+
aliases: %i[l n],
|
11
|
+
default: 10
|
12
|
+
},
|
13
|
+
shell: {
|
14
|
+
type: :string,
|
15
|
+
alias: :s,
|
16
|
+
default: File.basename(ENV["SHELL"] || "bash")
|
17
|
+
},
|
18
|
+
version: {
|
19
|
+
alias: :v
|
20
|
+
},
|
21
|
+
help: {
|
22
|
+
alias: :h
|
23
|
+
}
|
24
|
+
)
|
8
25
|
|
9
|
-
|
10
|
-
|
26
|
+
abort parsed.help if parsed.options.help
|
27
|
+
|
28
|
+
if parsed.options.version
|
29
|
+
abort File.read(File.expand_path("../../VERSION", __FILE__))
|
30
|
+
end
|
11
31
|
|
12
32
|
HISTORY =
|
13
|
-
case
|
33
|
+
case parsed.options.shell.to_s.downcase
|
14
34
|
when "fish"
|
15
35
|
File
|
16
36
|
.read("#{Dir.home}/.local/share/fish/fish_history")
|
@@ -22,7 +42,7 @@ HISTORY =
|
|
22
42
|
when "zsh"
|
23
43
|
File.read("#{Dir.home}/.zsh_history").lines.map(&:strip)
|
24
44
|
else
|
25
|
-
raise NotImplementedError,
|
45
|
+
raise NotImplementedError, parsed.options.shell.to_s.downcase
|
26
46
|
end
|
27
47
|
|
28
48
|
puts(
|
@@ -40,5 +60,5 @@ puts(
|
|
40
60
|
"#{(command_count * 100 / HISTORY.size.to_f).round(3)}%\t" \
|
41
61
|
"#{command}"
|
42
62
|
end
|
43
|
-
.first(
|
63
|
+
.first(parsed.options.limit)
|
44
64
|
)
|
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.
|
4
|
+
version: 1.0.0
|
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-08-
|
11
|
+
date: 2024-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dorian-arguments
|