huffshell 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source :rubygems
2
2
  gemspec
3
+ gem 'rake'
3
4
  gem 'rspec'
4
5
  gem 'colorize'
5
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- huffshell (0.0.11)
4
+ huffshell (0.0.12)
5
5
  colorize
6
6
 
7
7
  GEM
@@ -10,6 +10,7 @@ GEM
10
10
  colorize (0.5.8)
11
11
  diff-lcs (1.1.3)
12
12
  multi_json (1.2.0)
13
+ rake (0.9.2.2)
13
14
  rspec (2.10.0)
14
15
  rspec-core (~> 2.10.0)
15
16
  rspec-expectations (~> 2.10.0)
@@ -29,5 +30,6 @@ PLATFORMS
29
30
  DEPENDENCIES
30
31
  colorize
31
32
  huffshell!
33
+ rake
32
34
  rspec
33
35
  simplecov
data/Readme.md CHANGED
@@ -1,9 +1,9 @@
1
1
  Huffshell
2
2
  ====================
3
3
 
4
- Huffshell is a gem for optimizing your aliases, programmatically.
4
+ Huffshell is a gem for suggesting new aliases, programmatically.
5
5
 
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.
6
+ Huffshell looks at your shell history and suggests 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
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
 
data/bin/huffshell CHANGED
@@ -41,4 +41,4 @@ cs.truncate!(30)
41
41
 
42
42
  puts ""
43
43
  puts "Command tree:"
44
- puts cs.to_print
44
+ puts cs.to_tree
@@ -19,10 +19,10 @@ class CommandSuggestor
19
19
  wordtree.root.children.keys
20
20
  end
21
21
 
22
- def to_print
22
+ def to_tree
23
23
  wordtree.root.map do |n|
24
24
  cs = CommandSuggestion.new(n.word_list)
25
- "#{n.to_print.chomp} #{cs.to_s}"
25
+ "#{n.to_tree.chomp} #{cs.to_s}"
26
26
  end
27
27
  end
28
28
  end
@@ -13,6 +13,7 @@ class AliasChecker
13
13
  @aliases = {}
14
14
  lines.each do |l|
15
15
  al = AliasLine.new(l)
16
+ next unless al.valid?
16
17
  @aliases[al.alias_name] = al.command
17
18
  end
18
19
  end
@@ -9,8 +9,12 @@ class AliasLine
9
9
  @line.split("=").first
10
10
  end
11
11
 
12
+ def valid?
13
+ @line.scan("!") != []
14
+ end
15
+
12
16
  def command
13
17
  c = @line.split("=")[1]
14
- c[1..(c.size-2)]
18
+ c[1..(c.size-2)] if c
15
19
  end
16
20
  end
@@ -15,7 +15,7 @@ class WordTree
15
15
  root.truncate!(minimum)
16
16
  end
17
17
 
18
- def to_print
19
- root.to_print
18
+ def to_tree
19
+ root.to_tree
20
20
  end
21
21
  end
@@ -64,7 +64,7 @@ class WordTreeNode
64
64
  list.reverse
65
65
  end
66
66
 
67
- def to_print
67
+ def to_tree
68
68
  return "" if root?
69
69
  "#{(" " * (level - 1))}" + "#{word}".green + " #{line_count}:\n"
70
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: huffshell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-26 00:00:00.000000000 Z
12
+ date: 2012-08-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
16
- requirement: &70275366759860 !ruby/object:Gem::Requirement
16
+ requirement: &70272688512560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70275366759860
24
+ version_requirements: *70272688512560
25
25
  description: A parser and recommendation system for your shell aliases based on your
26
26
  shell history
27
27
  email: paul.mckellar@gmail.com