huffshell 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- huffshell (0.0.9)
4
+ huffshell (0.0.10)
5
5
  colorize
6
6
 
7
7
  GEM
data/Readme.md CHANGED
@@ -1,13 +1,15 @@
1
- HuffShell
1
+ Huffshell
2
2
  ====================
3
3
 
4
- HuffShell is a gem for optimizing your ZSH aliases, programmatically.
4
+ Huffshell is a gem for optimizing your ZSH aliases, programmatically.
5
5
 
6
- The gems looks at your history which can be automatically stored and generates aliases based on your usage. Your history is used to determine what you use the most and generate the shortest commands based on usage.
6
+ Huffshell looks at your shell history and generates aliases based on your typical usage. Memorable and short commands are suggested for the most common things you type to save you the most keystrokes.
7
7
 
8
- For example, you use 'git' 500 times and you use 'ls -l' 100 times. You should add aliases that are 'g' and 'll'. It could save you hundreds of keystrokes.
8
+ For example, if you type 'git' 500 times and 'ls -l' 100 times, good aliases might be 'g' and 'll'. It could save you hundreds of keystrokes.
9
9
 
10
- In order to do that, huffshell generates stats of your usage and gives them to you, as you might hope.
10
+ Additionally, huffshell prints out stats on what your usage for people who are just curious.
11
+
12
+ No changes are made to your shell. Only recommendations are printed to screen.
11
13
 
12
14
  Features
13
15
  ---------------------
@@ -45,7 +47,7 @@ gem update huffshell
45
47
  De-duplication
46
48
  ---------------------
47
49
 
48
- Many people have some form of deduplication on their ZSH history. That is a gret feature but will prevent you from getting all of the benifits of alias generation. If you are curious and want to see a better picture of your shell usage, here is a zsh configuration which remove deduping and creates a more accurate picture.
50
+ Many people have some form of de-duplication on their ZSH history. That is a great feature but will prevent you from getting all of the benefits of alias generation. If you are curious and want to see a better picture of your shell usage, here is a zsh configuration which remove de-duping and creates a more accurate picture.
49
51
 
50
52
  ```script
51
53
  ## Command history configuration
@@ -26,7 +26,7 @@ private
26
26
  end
27
27
 
28
28
  def exists?
29
- binary_checker.exist? || alias_checker.exist?(abbreviation)
29
+ binary_checker.exist? || (alias_checker && alias_checker.exist?(abbreviation))
30
30
  end
31
31
 
32
32
  def binary_checker
@@ -3,6 +3,11 @@ class AliasChecker
3
3
 
4
4
  def initialize(filename)
5
5
  @filename = filename
6
+
7
+ if !File.exist?(File.expand_path(filename))
8
+ return
9
+ end
10
+
6
11
  file_contents = File.open(File.expand_path(filename), 'r').read
7
12
  lines = file_contents.split("\n")
8
13
  @aliases = {}
@@ -13,6 +18,6 @@ class AliasChecker
13
18
  end
14
19
 
15
20
  def exist?(alias_name)
16
- !!@aliases[alias_name]
21
+ @aliases && !!@aliases[alias_name]
17
22
  end
18
23
  end
metadata CHANGED
@@ -1,46 +1,35 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: huffshell
3
- version: !ruby/object:Gem::Version
4
- hash: 13
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.10
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 9
10
- version: 0.0.9
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Paul McKellar
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-06-20 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-06-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: colorize
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70344066070840 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- description: A parser and recommendation system for your shell aliases based on your shell history
23
+ prerelease: false
24
+ version_requirements: *70344066070840
25
+ description: A parser and recommendation system for your shell aliases based on your
26
+ shell history
36
27
  email: paul.mckellar@gmail.com
37
- executables:
28
+ executables:
38
29
  - huffshell
39
30
  extensions: []
40
-
41
31
  extra_rdoc_files: []
42
-
43
- files:
32
+ files:
44
33
  - lib/command/command_suggestion.rb
45
34
  - lib/command/command_suggestor.rb
46
35
  - lib/command/command_word.rb
@@ -57,39 +46,28 @@ files:
57
46
  - Gemfile.lock
58
47
  - Rakefile
59
48
  - Readme.md
60
- has_rdoc: true
61
49
  homepage: https://github.com/paulmars/huffshell
62
50
  licenses: []
63
-
64
51
  post_install_message:
65
52
  rdoc_options: []
66
-
67
- require_paths:
53
+ require_paths:
68
54
  - lib
69
- required_ruby_version: !ruby/object:Gem::Requirement
55
+ required_ruby_version: !ruby/object:Gem::Requirement
70
56
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
78
- required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
62
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
87
67
  requirements: []
88
-
89
68
  rubyforge_project:
90
- rubygems_version: 1.6.2
69
+ rubygems_version: 1.8.10
91
70
  signing_key:
92
71
  specification_version: 3
93
72
  summary: Automatic shell alias recommondations based on usage!
94
73
  test_files: []
95
-