rubdo 0.1.7 → 0.1.8
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.
- data/README.md +1 -3
- data/bin/rubdo +3 -10
- data/lib/rubdo/cli.rb +8 -4
- data/lib/rubdo/version.rb +1 -1
- metadata +2 -3
data/README.md
CHANGED
@@ -20,7 +20,6 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
Here are the available commands for `rubdo`
|
22
22
|
|
23
|
-
|
24
23
|
Commands for rubdo:
|
25
24
|
------------------
|
26
25
|
add/a [task description] - Add a new task. If the description is empty, $EDITOR is opened
|
@@ -32,7 +31,7 @@ Here are the available commands for `rubdo`
|
|
32
31
|
remove/rm [task id] - Deletes the specific task
|
33
32
|
help - Prints out this information
|
34
33
|
|
35
|
-
`rubdo` createas _
|
34
|
+
`rubdo` createas _~/.tasks_ where it holds the YAML files with the todos inside.
|
36
35
|
If you want to keep your todos synced accross your machines, make a symlink to say
|
37
36
|
a directory inside of _~/Dropbox_
|
38
37
|
|
@@ -47,7 +46,6 @@ for `bash` and `zsh`
|
|
47
46
|
|
48
47
|
and add that to your _{bash, zsh}rc_
|
49
48
|
|
50
|
-
|
51
49
|
## Contributing
|
52
50
|
|
53
51
|
1. Fork it
|
data/bin/rubdo
CHANGED
@@ -1,17 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require 'rubdo'
|
6
|
-
require 'abbrev'
|
7
|
-
rescue LoadError
|
8
|
-
require 'rubygems'
|
9
|
-
require 'rubdo'
|
10
|
-
require 'abbrev'
|
11
|
-
end
|
3
|
+
require 'rubdo'
|
4
|
+
require 'abbrev'
|
12
5
|
|
13
6
|
cli = Rubdo::CLI.new
|
14
|
-
methods = Rubdo::CLI.public_instance_methods(false).
|
7
|
+
methods = Rubdo::CLI.public_instance_methods(false).map(&:to_s).abbrev
|
15
8
|
cli.list if ARGV[0].nil?
|
16
9
|
cli.send methods[ARGV[0]] unless ARGV[0].nil?
|
17
10
|
cli.save
|
data/lib/rubdo/cli.rb
CHANGED
@@ -4,17 +4,17 @@ module Rubdo
|
|
4
4
|
class CLI
|
5
5
|
def initialize
|
6
6
|
@list = List.new
|
7
|
-
@id = ARGV[1].to_i - 1
|
7
|
+
@id = ARGV[1].to_i - 1
|
8
8
|
end
|
9
9
|
|
10
10
|
def add
|
11
11
|
if ARGV[1]
|
12
|
-
@list.add ARGV[1]
|
12
|
+
@list.add ARGV[1]
|
13
13
|
else
|
14
14
|
tmp_file = Tempfile.new('new_task')
|
15
15
|
system("$EDITOR #{tmp_file.path}")
|
16
16
|
unless File.read(tmp_file.path).empty?
|
17
|
-
@list.add File.read(tmp_file).chomp
|
17
|
+
@list.add File.read(tmp_file).chomp
|
18
18
|
tmp_file.delete
|
19
19
|
else
|
20
20
|
puts "aborted due to empty file"
|
@@ -48,6 +48,7 @@ module Rubdo
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def edit
|
51
|
+
abort("not a valid id") if @id == -1 or @id > @list.items.length
|
51
52
|
tmp_file = Tempfile.new('new_desc')
|
52
53
|
File.open(tmp_file.path, 'w') { |f| f.write(@list.items[@id].description) }
|
53
54
|
system("$EDITOR #{tmp_file.path}")
|
@@ -62,7 +63,7 @@ module Rubdo
|
|
62
63
|
def help
|
63
64
|
puts <<-HELP
|
64
65
|
Commands for rubdo:
|
65
|
-
|
66
|
+
-----------------
|
66
67
|
add/a [task description] - Add a new task. If the description is empty, $EDITOR is opened
|
67
68
|
list/ls - Lists all tasks
|
68
69
|
completed - List all completed tasks
|
@@ -73,5 +74,8 @@ remove/rm [task id] - Deletes the specific task
|
|
73
74
|
help - Prints out this information
|
74
75
|
HELP
|
75
76
|
end
|
77
|
+
|
78
|
+
alias_method :ls, :list
|
79
|
+
alias_method :rm, :remove
|
76
80
|
end
|
77
81
|
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.8
|
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-
|
12
|
+
date: 2012-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A quick and dirty todo application
|
15
15
|
email:
|
@@ -56,4 +56,3 @@ signing_key:
|
|
56
56
|
specification_version: 3
|
57
57
|
summary: A quick and dirty todo application
|
58
58
|
test_files: []
|
59
|
-
has_rdoc:
|