rubdo 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/bin/rubdo +5 -1
  2. data/lib/rubdo/cli.rb +10 -13
  3. data/lib/rubdo/version.rb +1 -1
  4. metadata +2 -2
data/bin/rubdo CHANGED
@@ -1,13 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+
3
4
  begin
4
5
  require 'rubdo'
6
+ require 'abbrev'
5
7
  rescue LoadError
6
8
  require 'rubygems'
7
9
  require 'rubdo'
10
+ require 'abbrev'
8
11
  end
9
12
 
10
13
  cli = Rubdo::CLI.new
14
+ methods = Rubdo::CLI.public_instance_methods(false).sort.map(&:to_s).abbrev
11
15
  cli.list if ARGV[0].nil?
12
- cli.send ARGV[0] unless ARGV[0].nil?
16
+ cli.send methods[ARGV[0]] unless ARGV[0].nil?
13
17
  cli.save
data/lib/rubdo/cli.rb CHANGED
@@ -8,14 +8,17 @@ module Rubdo
8
8
  end
9
9
 
10
10
  def add
11
- @list.add ARGV[1] if ARGV[1]
12
- tmp_file = Tempfile.new('new_task')
13
- system("$EDITOR #{tmp_file.path}")
14
- unless File.read(tmp_file.path).empty?
15
- @list.add File.read(tmp_file).chomp
16
- tmp_file.delete
11
+ if ARGV[1]
12
+ @list.add ARGV[1] if ARGV[1]
17
13
  else
18
- puts "aborted due to empty file"
14
+ tmp_file = Tempfile.new('new_task')
15
+ system("$EDITOR #{tmp_file.path}")
16
+ unless File.read(tmp_file.path).empty?
17
+ @list.add File.read(tmp_file).chomp
18
+ tmp_file.delete
19
+ else
20
+ puts "aborted due to empty file"
21
+ end
19
22
  end
20
23
  end
21
24
 
@@ -70,11 +73,5 @@ remove/rm [task id] - Deletes the specific task
70
73
  help - Prints out this information
71
74
  HELP
72
75
  end
73
-
74
- alias_method :a, :add
75
- alias_method :ls, :list
76
- alias_method :d, :done
77
- alias_method :e, :edit
78
- alias_method :rm, :remove
79
76
  end
80
77
  end
data/lib/rubdo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rubdo
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubdo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
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: 2012-08-19 00:00:00.000000000 Z
12
+ date: 2012-08-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A quick and dirty todo application
15
15
  email: