agen 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -1
- data/lib/agen/finder.rb +7 -1
- data/lib/agen/version.rb +1 -1
- 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: 49b4f1125783920bc7b25522ff96b7ef31f606b901ac192c024931bd0aa20fc5
|
4
|
+
data.tar.gz: b4777fa42d27ec416573a867565563427b216422f12522f964645d32f1fd0ef8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdf675badd54139d2f548cccb525ab228ab68236abac838e69de9d993cc848f8d15e6ed4b9cec30434d1d39e2eaace17b2e86ae8d8104dbfddd6df13924ac861
|
7
|
+
data.tar.gz: 4247034d929c40541592da4bb6232d464560aef83f2fe97541851e3b701c03eba5737b84579c48e9564471be872471f8f0f671d0de5baf0cb56d52721ada4067
|
data/Gemfile.lock
CHANGED
data/lib/agen/finder.rb
CHANGED
@@ -8,7 +8,13 @@ module Agen
|
|
8
8
|
|
9
9
|
def commands(limit = 5)
|
10
10
|
File.readlines(@histfile).reverse.each_with_object(Hash.new(0)) do |line, commands|
|
11
|
-
|
11
|
+
begin
|
12
|
+
cmd = line.split(";").last.delete("\n")
|
13
|
+
if cmd != ""
|
14
|
+
commands[line.split(";").last.delete("\n")] += 1
|
15
|
+
end
|
16
|
+
rescue
|
17
|
+
end
|
12
18
|
end.sort_by { |k, v| -v }.to_h.keys.first(limit)
|
13
19
|
end
|
14
20
|
end
|
data/lib/agen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Thom
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.1.4
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Generate shell aliases based on commonly entered commands.
|