dorian-top 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/top +6 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b2ec58c2a524050a159a7388b70d2de509b7d2467c02fdb15e761408364bbbd
4
- data.tar.gz: 280dbff3381a1afa4126c828bf634f3d76d149e290c8387bdcaab1f944f774ec
3
+ metadata.gz: 79229b911c817146536894a996c8fcd06ec5dfb9fe0076853f6237274968b596
4
+ data.tar.gz: '00691032225c23d31e1b7d875c97cac98c05a774cd60b14ae552294175dd5865'
5
5
  SHA512:
6
- metadata.gz: 2c4cd8af0d22853db95f43d8c49af9db63e0acb205933482dfea3d9b36beecd63bc07cbe87fabcc48c14a0efa9c4d7e580b6e2821fdb2df64de268594b4da904
7
- data.tar.gz: 066ad851d484a2949bf4c2469c0dbd7536043026b61a2ca7101208858acbfa50ecb22698457b3ed340cf1a31e06e0a6c451fe74c751079ac89506f243a499d77
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
- if SHELL == "fish"
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
- elsif SHELL == "bash"
20
+ when "bash"
20
21
  File.read("#{Dir.home}/.bash_history").lines.map(&:strip)
21
- elsif SHELL == "zsh"
22
+ when "zsh"
22
23
  File.read("#{Dir.home}/.zsh_history").lines.map(&:strip)
23
24
  else
24
- raise NotImplementedError.new(SHELL)
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
- "#{command}"
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.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-03-09 00:00:00.000000000 Z
11
+ date: 2024-04-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Lists the most used commands