agen 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -2
- data/exe/agen +0 -2
- data/lib/agen/builder.rb +6 -2
- 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: 88c5c183242fa63c57940eba901e982778e930921fdaf8eda8ba2c64a23801f0
|
4
|
+
data.tar.gz: 262a494cd57ad6d3ee4474eee51a686a94309084222b5fc4b128be7ce35e5f40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d994611c28f6f086450a4baf40e842cff15108cedaeba542710827ec77499f41086bcc1f334866873c1f3ef167588885ede145de26afb60eb30f6644036ba0ca
|
7
|
+
data.tar.gz: d553d15e0420538459819547d86faa117244833080ad27dc35177d776a2e37a2996c047042acdd0aa5d426da02df1060e0413f9cc5c09590b24a9b3a50804f52
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,8 +6,9 @@ Generate shell aliases based on your most commonly entered commands.
|
|
6
6
|
|
7
7
|
## Installation & Usage
|
8
8
|
|
9
|
-
Install with `gem install agen` and then run `agen` to build your aliases.
|
10
|
-
`agen -h` to see
|
9
|
+
Install with `gem install agen` and then run `agen` to build your aliases. Then
|
10
|
+
be sure to `source ~/.zshrc` before using the new aliases. Use `agen -h` to see
|
11
|
+
available options.
|
11
12
|
|
12
13
|
Right now, this will only work with `zsh`, but support for other shells is on
|
13
14
|
the very lengthy todo list. By default, agen reads from `.zsh_history` and
|
data/exe/agen
CHANGED
data/lib/agen/builder.rb
CHANGED
@@ -8,18 +8,22 @@ module Agen
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def aliases
|
11
|
+
aliases = []
|
11
12
|
@commands.map do |cmd|
|
12
13
|
aliaz = cmd.scan(/\b\w/).join
|
13
14
|
|
14
15
|
# Is is possibly we could overwrite a command here still? Sure.
|
15
16
|
# I will live with it for now.
|
16
|
-
if command_already_exists?(aliaz)
|
17
|
+
if command_already_exists?(aliaz) || aliases.include?(aliaz)
|
17
18
|
# We could improve to look more like the original command, but again, works for now.
|
18
19
|
aliaz += aliaz[-1]
|
19
20
|
end
|
20
21
|
|
21
22
|
candidate = "alias #{aliaz}=\"#{cmd}\""
|
22
|
-
|
23
|
+
if alias_does_not_exist?(candidate)
|
24
|
+
aliases << aliaz
|
25
|
+
candidate
|
26
|
+
end
|
23
27
|
end.compact
|
24
28
|
end
|
25
29
|
|
data/lib/agen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Thom
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|