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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f50ecb308bcaae7e0fbcf71786c9fc90ba4eb53f
4
- data.tar.gz: 0fcba3824fd50f877a946d7cc2d879f0b29f3ec7
3
+ metadata.gz: 53cd77cf14a3f48903b8573ebebfc619a4a2524c
4
+ data.tar.gz: 287fc4a5186b5f94a8451886a65e4623482cf5bf
5
5
  SHA512:
6
- metadata.gz: d4a06691f85e1a70323c3c01a1eee688c3ca674249d1e8085a4fc6166def03c62484a342a86122e78e49ee34ab845a91833434b6a815a48c147d6a0ecf925a43
7
- data.tar.gz: 4ecfdd239ddc9ac85d5d5a143b82093c77124873bd22f73512d69679ea33cabda25d727830583d9b5e4adada9f9a240d64629208cba3f9521aaecb69439cf417
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 optimise your laziness. It displays your most often used shell commands so that you can change them into aliases and eventually type less.
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 --color'
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
 
@@ -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(history_file_path).force_encoding('BINARY').
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
- raise "Missing both zsh and bash history files"
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
@@ -1,3 +1,3 @@
1
1
  module Lazyme
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
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.1
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: 2017-12-10 00:00:00.000000000 Z
11
+ date: 2018-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: terminal-table