lazyme 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -2
- data/lib/lazyme.rb +8 -2
- data/lib/lazyme/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53cd77cf14a3f48903b8573ebebfc619a4a2524c
|
4
|
+
data.tar.gz: 287fc4a5186b5f94a8451886a65e4623482cf5bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddf2e6f9876f5eca3e5b36a19ef1810141439b46ec9d1843029d4b09f24585c1228a7453f3e8e6e5fa9c55c0958715a311af1579441a03c0f8f8c26f6b4f3caf
|
7
|
+
data.tar.gz: 1ea23fcd9add1d1b8d8b4a37fa6e43ce167099286304f34e2b3deec5c39bb22ca5ec59868880bde243ec4ab57efae98b97d2c4ba6b99cde2e208f14e39efba35
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Lazyme [![Gem Version](https://badge.fury.io/rb/lazyme.svg)](http://badge.fury.io/rb/lazyme)
|
2
2
|
|
3
|
-
Lazyme is a simple gem that helps you
|
3
|
+
Lazyme is a simple gem that helps you optimize your laziness. It displays your most often used shell commands so that you can change them into aliases and eventually type less.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
```bash
|
@@ -40,7 +40,18 @@ lazyme =>
|
|
40
40
|
You can set aliases by adding following lines into your `.bashrc` or `.zshrc` files:
|
41
41
|
|
42
42
|
```
|
43
|
-
alias gr='grep
|
43
|
+
alias gr='grep — color'
|
44
|
+
alias g='git status'
|
44
45
|
alias gaa='git add . -A'
|
46
|
+
|
47
|
+
function gm() {
|
48
|
+
git commit -m "$*"
|
49
|
+
}
|
50
|
+
```
|
51
|
+
|
52
|
+
If your history file is in a nonstandard location you need to provide its path when running the `lazyme` command:
|
53
|
+
|
54
|
+
```
|
55
|
+
lazyme ~/files/history
|
45
56
|
```
|
46
57
|
|
data/lib/lazyme.rb
CHANGED
@@ -13,8 +13,9 @@ module Lazyme
|
|
13
13
|
|
14
14
|
def call
|
15
15
|
count = Hash.new(0)
|
16
|
+
return unless path = history_file_path
|
16
17
|
|
17
|
-
File.read(
|
18
|
+
File.read(path).force_encoding('BINARY').
|
18
19
|
encode("UTF-8", invalid: :replace, undef: :replace).
|
19
20
|
split("\n").map do |line|
|
20
21
|
line.split(';').last
|
@@ -51,12 +52,17 @@ module Lazyme
|
|
51
52
|
end
|
52
53
|
|
53
54
|
def history_file_path
|
55
|
+
if path = ARGV[0]
|
56
|
+
return path
|
57
|
+
end
|
58
|
+
|
54
59
|
if File.exist?(File.expand_path('~/.zsh_history'))
|
55
60
|
File.expand_path('~/.zsh_history')
|
56
61
|
elsif File.exist?(File.expand_path('~/.bash_history'))
|
57
62
|
File.expand_path('~/.bash_history')
|
58
63
|
else
|
59
|
-
|
64
|
+
puts "I cannot find your history file. \n You can provide file path as an argument: \n\n lazyme ~/files/history \n\n"
|
65
|
+
false
|
60
66
|
end
|
61
67
|
end
|
62
68
|
end
|
data/lib/lazyme/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazyme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: terminal-table
|