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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acebf067e22c29311b6a91e2b24e5e8c3f822e24ec8d0a3b5221721e8c147b6a
4
- data.tar.gz: 55129b76da51036069bfbc0890af80ef6b0d2ff57479666cd92d833327e81263
3
+ metadata.gz: 49b4f1125783920bc7b25522ff96b7ef31f606b901ac192c024931bd0aa20fc5
4
+ data.tar.gz: b4777fa42d27ec416573a867565563427b216422f12522f964645d32f1fd0ef8
5
5
  SHA512:
6
- metadata.gz: 385c8d66a02051d68bce4de28b3c81c8fb106c509e2f2bfa14825dd4440b21399f3060ddee26a78ba6e5e3638a34429d1c992cb04d12939b9bad935ef00373d0
7
- data.tar.gz: 433e67ddc92ac47d02c9618a1741bde74e3c8bd0f8621f1f4488270ea6d30a69f2664fd40c14eb97f70ae2f578e97c9180a969c66a5bae869d3b1fdf9c59df15
6
+ metadata.gz: cdf675badd54139d2f548cccb525ab228ab68236abac838e69de9d993cc848f8d15e6ed4b9cec30434d1d39e2eaace17b2e86ae8d8104dbfddd6df13924ac861
7
+ data.tar.gz: 4247034d929c40541592da4bb6232d464560aef83f2fe97541851e3b701c03eba5737b84579c48e9564471be872471f8f0f671d0de5baf0cb56d52721ada4067
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- agen (0.1.0)
4
+ agen (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -49,6 +49,7 @@ GEM
49
49
  unicode-display_width (2.0.0)
50
50
 
51
51
  PLATFORMS
52
+ ruby
52
53
  x86_64-darwin-20
53
54
  x86_64-linux
54
55
 
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
- commands[line.split(";").last.delete("\n")] += 1
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Agen
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
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.0
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.2.15
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.