rubdo 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rubdo +5 -1
- data/lib/rubdo/cli.rb +10 -13
- data/lib/rubdo/version.rb +1 -1
- 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
|
-
|
12
|
-
|
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
|
-
|
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
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.
|
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-
|
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:
|