aka 0.5.2 → 0.5.4

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
- aka (0.4.5)
4
+ aka (0.5.4)
5
5
  methadone (~> 1.2.4)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -33,6 +33,9 @@ Or you can use `aka`.
33
33
  1. Enjoy having your command line say `hi there` back to you
34
34
  5. run `aka -h` to see a full list of features.
35
35
 
36
+
37
+ **Quick note:** Mostly for my own peace of mind, running `aka -d` creates a backup copy of your alias file as `.alias.bak` before cleaning out your current alias file. So if you really want to get rid of any sign of your aliases you'll need to manually delete that file as well.
38
+
36
39
  ## Contributing
37
40
 
38
41
  Pull requests and issues are very welcome. If you have time, please include a solution or a test with any issues you submit.
data/README.rdoc CHANGED
@@ -6,24 +6,31 @@ Copyright:: Copyright (c) 2013 Nate Dickson
6
6
 
7
7
  License:: mit, see LICENSE.txt
8
8
 
9
- aka lets you store all of your unix-style aliases in a single file.
9
+ aka lets you store all of your unix-style aliases in a single file.
10
10
 
11
- Add <code>source ~/.alias</code> to your profile.
11
+ To use this app follow these steps:
12
+
13
+ * Add +source ~/.alias+ to your profile.
14
+ * Install the app using +gem install aka+
15
+ * A good first alias to add is +aka -a reload "source ~/.alias"+
16
+ * Once you've added that you'll have to either start a new session or manually run +source ~/.alias"
17
+ * From here on out, whenever you add a new alias, you can just type +reload+ and it'll be available immediately!
18
+ * Check out all the other available commands by running +aka -h+
12
19
 
13
20
 
14
21
  == Links
15
22
 
16
- * {http://poginate.github.com/A.K.A./}[LINK TO GITHUB]
17
- * RDoc[LINK TO RDOC.INFO]
23
+ * {View the source on github}[http://poginate.github.com/A.K.A./]
24
+
18
25
 
19
26
  == Install
20
27
 
21
- <code>gem install aka</code>
28
+ +gem install aka+
22
29
 
23
30
  == Examples
24
31
 
25
- * To add a new alias enter <code>aka -a hi "echo "hi there!"</code>
26
- * enter <code>aka -h</code> to see the other available commands.
32
+ * To add a new alias enter +aka -a hi "echo "hi there!"+
33
+ * enter +aka -h+ to see the other available commands.
27
34
 
28
35
  == Contributing
29
36
 
data/aka-0.5.2.gem ADDED
Binary file
data/aka.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["nate@natedickson.com"]
11
11
  gem.description = %q{Manage your aliases with style}
12
12
  gem.summary = %q{Manages your list of aliases from an easy and friendly command line interface.}
13
- gem.homepage = "https://github.com/PogiNate/A.K.A."
13
+ gem.homepage = "http://poginate.github.com/A.K.A./"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
data/bin/aka CHANGED
@@ -15,8 +15,9 @@ class App
15
15
  options.each do |key, value|
16
16
  debug("#{key} : #{value}")
17
17
  end
18
- al.backup if options[:backup]
19
- al.list if options[:list]
18
+ al.backup if options[:backup]
19
+ al.list if options[:list]
20
+ al.showAll if options[:L]
20
21
  if options[:show]
21
22
  if aliasString == nil
22
23
  fatal("Needs an alias string to show the related command!")
@@ -48,12 +49,13 @@ class App
48
49
 
49
50
  description "Manage your aliases without editing dot files."
50
51
 
51
- on("-a", "--add", "Add a new alias")
52
- on("-l", "--list", "List all current aliases")
53
- on("-r", "--remove", "Remove the specified alias")
54
- on("-s", "--show", "Show what the specified alias does")
55
- on("-b", "--backup", "Create a backup copy of your alias file")
56
- on("-d", "--delete", "Delete all keys from your alias file")
52
+ on("-a", "--add", "Add a new alias")
53
+ on("-l", "--list", "List all current aliases")
54
+ on("-r", "--remove", "Remove the specified alias")
55
+ on("-s", "--show", "Show what the specified alias does")
56
+ on("-b", "--backup", "Create a backup copy of your alias file")
57
+ on("-d", "--delete", "Delete all keys from your alias file")
58
+ on("-L", "--list-all","Display all aliases and their associated commands.")
57
59
 
58
60
  arg :alias, :optional
59
61
  arg :value, :optional
data/lib/aka/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Aka
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.4"
3
3
  end
data/lib/aka.rb CHANGED
@@ -28,44 +28,59 @@ module Aka
28
28
  #add a new alias to the list
29
29
  @aliases[string] = command
30
30
  writeOut
31
+ info "#{string} added to your alias list."
31
32
  end
32
33
 
33
34
  def remove string
34
- #remove the alias from the list.
35
35
  @aliases.delete string
36
36
  writeOut
37
+ info "#{string} removed from your alias list."
37
38
  end
38
39
 
39
40
  def list
40
- #return the list of aliases.
41
41
  keyList = ""
42
42
  @aliases.keys.each{|key| keyList = keyList+" #{key}" }
43
43
  info(keyList)
44
44
  end
45
45
 
46
+ def showAll
47
+ keyList = ""
48
+ @aliases.each{|key, value| keyList = keyList + "#{key}: #{value}\n"}
49
+ info keyList
50
+ end
51
+
46
52
  def show string
47
- #return the command of a single alias.
48
53
  info(@aliases[string])
49
54
  end
50
55
 
51
56
  def empty
52
- #empty out the file.
53
- backup # So we don't have deleter's remorse.
54
- @aliases = {}
55
- writeOut
57
+ info "Would you like to create a backup before deleting? (y/n/a)"
58
+ backConfirm = gets.chomp.downcase
59
+ if backConfirm.start_with? "y"
60
+ backup
61
+ @aliases = {}
62
+ writeOut
63
+ info "Alias list deleted."
64
+ elsif backConfirm.start_with? "a"
65
+ info "Alias list deletion aborted."
66
+ elsif backConfirm.start_with? "n"
67
+ @aliases = {}
68
+ writeOut
69
+ info "Alias list deleted."
70
+ else
71
+ info "I didn't understand your response; so your file was not deleted."
72
+ end
56
73
  end
57
74
 
58
75
  def backup
59
76
  FileUtils.copy(@fileName,"#{@fileName}.bak")
77
+ info "Backup created as #{@fileName}.bak"
60
78
  end
61
79
 
62
80
  def writeOut
63
81
  filestring = ""
64
- @aliases.each { |key, value| filestring = filestring + "alias #{key}=\"#{value}\"\n" }
65
-
82
+ @aliases.sort.each { |key, value| filestring = filestring + "alias #{key}=\"#{value}\"\n" }
66
83
  File.open(@fileName, "w") { |file| file.write filestring }
67
-
68
- #write out the list. This will be called after any method that changes something.
69
84
  end
70
85
  end
71
86
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-08 00:00:00.000000000 Z
12
+ date: 2013-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
@@ -90,7 +90,7 @@ files:
90
90
  - README.md
91
91
  - README.rdoc
92
92
  - Rakefile
93
- - aka-0.5.1.gem
93
+ - aka-0.5.2.gem
94
94
  - aka.gemspec
95
95
  - bin/aka
96
96
  - features/add.feature
@@ -105,7 +105,7 @@ files:
105
105
  - lib/aka.rb
106
106
  - lib/aka/version.rb
107
107
  - test/tc_something.rb
108
- homepage: https://github.com/PogiNate/A.K.A.
108
+ homepage: http://poginate.github.com/A.K.A./
109
109
  licenses: []
110
110
  post_install_message:
111
111
  rdoc_options: []
data/aka-0.5.1.gem DELETED
Binary file