todorb 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/Makefile +3 -2
- data/Rakefile +12 -2
- data/VERSION +1 -1
- data/lib/common/cmdapp.rb +41 -8
- data/lib/common/sed.rb +9 -6
- data/lib/todorb.rb +309 -144
- data/tests/data.1 +14 -0
- data/tests/data.2 +7 -0
- data/tests/rtest2.sh +11 -6
- data/tests/t0001-help.sh +97 -0
- data/tests/t0002-subc_help.sh +41 -0
- data/tests/t0003-add.sh +19 -0
- data/tests/{t0002-listing.sh → t0004-list.sh} +6 -5
- data/tests/t0005-pri.sh +43 -0
- data/tests/t0006-pri_sort.sh +55 -0
- data/tests/t0007-status.sh +78 -0
- data/tests/t0008-addsub.sh +78 -0
- data/tests/t0009-del.sh +43 -0
- data/tests/test-lib.sh +13 -9
- data/todorb.gemspec +18 -6
- metadata +29 -9
- data/tests/t0001-add.sh +0 -22
data/tests/rtest2.sh
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
#*******************************************************#
|
3
|
-
#
|
3
|
+
# rtest2.sh #
|
4
4
|
# written by Rahul Kumar #
|
5
5
|
# December 21, 2009 #
|
6
6
|
# #
|
@@ -70,6 +70,7 @@ do
|
|
70
70
|
# read line
|
71
71
|
[ -z "$line" ] && { echo "bye to quit"; continue; }
|
72
72
|
[[ "$line" = "bye" ]] && break;
|
73
|
+
[[ "$line" = "abort" ]] && exit 1;
|
73
74
|
[ -n "$line" ] && history -s "$line"
|
74
75
|
|
75
76
|
## user can execute test_tick in current shell
|
@@ -83,16 +84,20 @@ do
|
|
83
84
|
line=$( echo "$line" | sed 's/^list/t --sort-serial list/')
|
84
85
|
fi
|
85
86
|
if grep -q "^ls" <<< "$line"; then
|
86
|
-
line=$( echo "$line" | sed 's/^ls/t --sort-serial --no-colors
|
87
|
+
line=$( echo "$line" | sed 's/^ls/t list --sort-serial --no-colors /')
|
87
88
|
fi
|
88
89
|
line=$(echo "$line" | sed 's/--ss /--sort-serial /')
|
89
90
|
line=$(echo "$line" | sed 's/--nc /--no-colors /')
|
90
91
|
#[[ "$line" = "list" ]] && line="t --sort-serial list";
|
91
92
|
#[[ "$line" = "ls" ]] && line="t --sort-serial --no-colors list";
|
92
|
-
line=$(echo "$line" | sed 's
|
93
|
-
|
94
|
-
|
95
|
-
|
93
|
+
line=$(echo "$line" | sed 's~^t ~todorb ~')
|
94
|
+
if [[ "$line" != "end" ]]; then
|
95
|
+
echo ">>> $line" >> $out
|
96
|
+
eval "$line" | tee -a "$out"
|
97
|
+
# RK since old version stopped expect on blank line I've placed this marker
|
98
|
+
echo ">>> end" >> $out
|
99
|
+
fi
|
100
|
+
#echo "" >> $out
|
96
101
|
done
|
97
102
|
|
98
103
|
## generate the test case transcript
|
data/tests/t0001-help.sh
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
test_description="Testing out ./t0001-help "
|
3
|
+
. ./test-lib.sh
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
test_todo_session "Testing of ./t0001-help" <<EOF
|
9
|
+
>>> todorb help
|
10
|
+
Usage: [options] [subcommand [options]]
|
11
|
+
Todo list manager
|
12
|
+
-v, --[no-]verbose Run verbosely
|
13
|
+
-f, --file FILENAME CSV filename
|
14
|
+
-d, --dir DIR Use TODO file in this directory
|
15
|
+
--show-actions show actions
|
16
|
+
--version Show version
|
17
|
+
-h, --help Show this message
|
18
|
+
|
19
|
+
Common Usage:
|
20
|
+
todorb add "Text ...."
|
21
|
+
todorb list
|
22
|
+
todorb pri 1 A
|
23
|
+
todorb close 1
|
24
|
+
|
25
|
+
Commands are:
|
26
|
+
list : List tasks. --show-all and others
|
27
|
+
add : Add a task.
|
28
|
+
pri : Add priority to task.
|
29
|
+
depri : Remove priority of task.
|
30
|
+
todorb depri <TASK>
|
31
|
+
delete : Delete a task.
|
32
|
+
todorb delete <TASK>
|
33
|
+
status : Change the status of a task. <STATUS> are open closed started pending hold next
|
34
|
+
redo : Renumbers the todo file starting 1
|
35
|
+
note : Add a note to a task.
|
36
|
+
tag : Add a tag to an item/s.
|
37
|
+
archive : archive closed tasks to archive.txt
|
38
|
+
copyunder : Move first task under second (as a subtask). aka cu
|
39
|
+
addsub : Add a task under another.
|
40
|
+
|
41
|
+
Aliases:
|
42
|
+
a - add
|
43
|
+
p - pri
|
44
|
+
del - delete
|
45
|
+
cu - copyunder
|
46
|
+
open - ["status", "open"]
|
47
|
+
close - ["status", "closed"]
|
48
|
+
|
49
|
+
|
50
|
+
See '/opt/local/bin/todorb help COMMAND' for more information on a specific command.
|
51
|
+
>>> end
|
52
|
+
>>> todorb --help
|
53
|
+
Usage: [options] [subcommand [options]]
|
54
|
+
Todo list manager
|
55
|
+
-v, --[no-]verbose Run verbosely
|
56
|
+
-f, --file FILENAME CSV filename
|
57
|
+
-d, --dir DIR Use TODO file in this directory
|
58
|
+
--show-actions show actions
|
59
|
+
--version Show version
|
60
|
+
-h, --help Show this message
|
61
|
+
|
62
|
+
Common Usage:
|
63
|
+
todorb add "Text ...."
|
64
|
+
todorb list
|
65
|
+
todorb pri 1 A
|
66
|
+
todorb close 1
|
67
|
+
|
68
|
+
Commands are:
|
69
|
+
list : List tasks. --show-all and others
|
70
|
+
add : Add a task.
|
71
|
+
pri : Add priority to task.
|
72
|
+
depri : Remove priority of task.
|
73
|
+
todorb depri <TASK>
|
74
|
+
delete : Delete a task.
|
75
|
+
todorb delete <TASK>
|
76
|
+
status : Change the status of a task. <STATUS> are open closed started pending hold next
|
77
|
+
redo : Renumbers the todo file starting 1
|
78
|
+
note : Add a note to a task.
|
79
|
+
tag : Add a tag to an item/s.
|
80
|
+
archive : archive closed tasks to archive.txt
|
81
|
+
copyunder : Move first task under second (as a subtask). aka cu
|
82
|
+
addsub : Add a task under another.
|
83
|
+
|
84
|
+
Aliases:
|
85
|
+
a - add
|
86
|
+
p - pri
|
87
|
+
del - delete
|
88
|
+
cu - copyunder
|
89
|
+
open - ["status", "open"]
|
90
|
+
close - ["status", "closed"]
|
91
|
+
|
92
|
+
|
93
|
+
See '/opt/local/bin/todorb help COMMAND' for more information on a specific command.
|
94
|
+
>>> end
|
95
|
+
|
96
|
+
EOF
|
97
|
+
test_done
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
test_description="Testing out subc_help "
|
3
|
+
. ./test-lib.sh
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
test_todo_session "Testing of subc_help" <<EOF
|
9
|
+
>>> todorb list --help
|
10
|
+
Usage: list [options]
|
11
|
+
List tasks. --show-all and others
|
12
|
+
-P, --project PROJECTNAME name of project for add or list
|
13
|
+
-p, --priority A-Z priority code for add or list
|
14
|
+
-C, --component COMPONENT component name for add or list
|
15
|
+
--[no-]color, --[no-]colors colorize listing
|
16
|
+
-s, --sort sort list on status,priority
|
17
|
+
--reverse sort list on status,priority reversed
|
18
|
+
-g, --grep REGEXP filter list on pattern
|
19
|
+
--renumber renumber while listing
|
20
|
+
--hide-numbering hide-numbering while listing
|
21
|
+
--[no-]show-all show all tasks (incl closed)
|
22
|
+
--show-arch show all tasks adding archived ones too
|
23
|
+
>>> end
|
24
|
+
>>> todorb help list
|
25
|
+
Usage: list [options]
|
26
|
+
List tasks. --show-all and others
|
27
|
+
-P, --project PROJECTNAME name of project for add or list
|
28
|
+
-p, --priority A-Z priority code for add or list
|
29
|
+
-C, --component COMPONENT component name for add or list
|
30
|
+
--[no-]color, --[no-]colors colorize listing
|
31
|
+
-s, --sort sort list on status,priority
|
32
|
+
--reverse sort list on status,priority reversed
|
33
|
+
-g, --grep REGEXP filter list on pattern
|
34
|
+
--renumber renumber while listing
|
35
|
+
--hide-numbering hide-numbering while listing
|
36
|
+
--[no-]show-all show all tasks (incl closed)
|
37
|
+
--show-arch show all tasks adding archived ones too
|
38
|
+
>>> end
|
39
|
+
|
40
|
+
EOF
|
41
|
+
test_done
|
data/tests/t0003-add.sh
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
test_description="Testing out add "
|
3
|
+
. ./test-lib.sh
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
test_todo_session "Testing of add" <<EOF
|
9
|
+
>>> todorb add "Add test cases for all operations"
|
10
|
+
Adding:
|
11
|
+
1 [ ] Add test cases for all operations (2009-02-13)
|
12
|
+
>>> end
|
13
|
+
>>> todorb add "Add complete date when closing"
|
14
|
+
Adding:
|
15
|
+
2 [ ] Add complete date when closing (2009-02-13)
|
16
|
+
>>> end
|
17
|
+
|
18
|
+
EOF
|
19
|
+
test_done
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/bin/sh
|
2
|
-
test_description="Testing out
|
2
|
+
test_description="Testing out list "
|
3
3
|
. ./test-lib.sh
|
4
4
|
|
5
5
|
|
@@ -20,8 +20,8 @@ cat > TODO2.txt <<CATEOF
|
|
20
20
|
7 [ ] list: search terms with - + and = (2010-06-15)
|
21
21
|
CATEOF
|
22
22
|
|
23
|
-
test_todo_session "Testing of
|
24
|
-
>>> todorb
|
23
|
+
test_todo_session "Testing of list" <<EOF
|
24
|
+
>>> todorb
|
25
25
|
3.1 [ ] hello there new a u 3 (2010-06-15)
|
26
26
|
3.1.1 [ ] hello there new a u 3 (2010-06-15)
|
27
27
|
3.1.2 [ ] hello there new a u 3 (2010-06-15)
|
@@ -35,8 +35,8 @@ test_todo_session "Testing of listing" <<EOF
|
|
35
35
|
7 [ ] list: search terms with - + and = (2010-06-15)
|
36
36
|
|
37
37
|
11 of 14 rows displayed from TODO2.txt
|
38
|
-
|
39
|
-
>>> todorb --
|
38
|
+
>>> end
|
39
|
+
>>> todorb list --show-all --no-color
|
40
40
|
1 [x] if no TODO file give proper message to add task (2010-06-14)
|
41
41
|
2 [x] what if no serial_number file? (2010-06-14)
|
42
42
|
3 [x] Add a close for status close (2010-06-14)
|
@@ -53,6 +53,7 @@ test_todo_session "Testing of listing" <<EOF
|
|
53
53
|
7 [ ] list: search terms with - + and = (2010-06-15)
|
54
54
|
|
55
55
|
14 of 14 rows displayed from TODO2.txt
|
56
|
+
>>> end
|
56
57
|
|
57
58
|
EOF
|
58
59
|
test_done
|
data/tests/t0005-pri.sh
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
test_description="Testing out pri "
|
3
|
+
. ./test-lib.sh
|
4
|
+
|
5
|
+
|
6
|
+
cat > TODO2.txt <<CATEOF
|
7
|
+
1 [x] if no TODO file give proper message to add task (2010-06-14)
|
8
|
+
2 [x] what if no serial_number file? (2010-06-14)
|
9
|
+
3 [x] Add a close for status close (2010-06-14)
|
10
|
+
3.1 [ ] hello there new a u 3 (2010-06-15)
|
11
|
+
3.1.1 [ ] hello there new a u 3 (2010-06-15)
|
12
|
+
3.1.2 [ ] hello there new a u 3 (2010-06-15)
|
13
|
+
3.1.3 [ ] hello there new a u 3 (2010-06-15)
|
14
|
+
3.2 [ ] hello there new a u 3.2 (2010-06-15)
|
15
|
+
3.2.1 [ ] hello there new a u 3.2.1 (2010-06-15)
|
16
|
+
3.2.1.1 [ ] hello there new a u 3.2.1.1 (2010-06-15)
|
17
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
18
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
19
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
20
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
21
|
+
CATEOF
|
22
|
+
|
23
|
+
test_todo_session "Testing of pri" <<EOF
|
24
|
+
>>> todorb pri 4 A
|
25
|
+
4 : [ ] start rubyforge project for todorb (2010-06-14)
|
26
|
+
[32m 4 : [ ] (A) start rubyforge project for todorb (2010-06-14) [0m
|
27
|
+
Changed priority of 1 task/s
|
28
|
+
>>> end
|
29
|
+
>>> todorb pri 5 B
|
30
|
+
5 : [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
31
|
+
[32m 5 : [ ] (B) list: if dir given then show full path of TODO2.txt at end (2010-06-14) [0m
|
32
|
+
Changed priority of 1 task/s
|
33
|
+
>>> end
|
34
|
+
>>> todorb pri C 6 7
|
35
|
+
6 : [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
36
|
+
[32m 6 : [ ] (C) allow for ENV VARS such as verbose, plain, force (2010-06-15) [0m
|
37
|
+
7 : [ ] list: search terms with - + and = (2010-06-15)
|
38
|
+
[32m 7 : [ ] (C) list: search terms with - + and = (2010-06-15) [0m
|
39
|
+
Changed priority of 2 task/s
|
40
|
+
>>> end
|
41
|
+
|
42
|
+
EOF
|
43
|
+
test_done
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
test_description="Testing out pri_sort "
|
3
|
+
. ./test-lib.sh
|
4
|
+
|
5
|
+
|
6
|
+
cat > TODO2.txt <<CATEOF
|
7
|
+
1 [x] if no TODO file give proper message to add task (2010-06-14)
|
8
|
+
2 [x] what if no serial_number file? (2010-06-14)
|
9
|
+
3 [x] Add a close for status close (2010-06-14)
|
10
|
+
3.1 [ ] hello there new a u 3 (2010-06-15)
|
11
|
+
3.1.1 [ ] hello there new a u 3 (2010-06-15)
|
12
|
+
3.1.2 [ ] hello there new a u 3 (2010-06-15)
|
13
|
+
3.1.3 [ ] hello there new a u 3 (2010-06-15)
|
14
|
+
3.2 [ ] hello there new a u 3.2 (2010-06-15)
|
15
|
+
3.2.1 [ ] hello there new a u 3.2.1 (2010-06-15)
|
16
|
+
3.2.1.1 [ ] hello there new a u 3.2.1.1 (2010-06-15)
|
17
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
18
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
19
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
20
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
21
|
+
CATEOF
|
22
|
+
|
23
|
+
test_todo_session "Testing of pri_sort" <<EOF
|
24
|
+
>>> todorb pri 4 6 B
|
25
|
+
4 : [ ] start rubyforge project for todorb (2010-06-14)
|
26
|
+
[32m 4 : [ ] (B) start rubyforge project for todorb (2010-06-14) [0m
|
27
|
+
6 : [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
28
|
+
[32m 6 : [ ] (B) allow for ENV VARS such as verbose, plain, force (2010-06-15) [0m
|
29
|
+
Changed priority of 2 task/s
|
30
|
+
>>> end
|
31
|
+
>>> todorb pri 5 7 A
|
32
|
+
5 : [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
33
|
+
[32m 5 : [ ] (A) list: if dir given then show full path of TODO2.txt at end (2010-06-14) [0m
|
34
|
+
7 : [ ] list: search terms with - + and = (2010-06-15)
|
35
|
+
[32m 7 : [ ] (A) list: search terms with - + and = (2010-06-15) [0m
|
36
|
+
Changed priority of 2 task/s
|
37
|
+
>>> end
|
38
|
+
>>> todorb list --sort
|
39
|
+
3.1 [ ] hello there new a u 3 (2010-06-15)
|
40
|
+
3.1.1 [ ] hello there new a u 3 (2010-06-15)
|
41
|
+
3.1.2 [ ] hello there new a u 3 (2010-06-15)
|
42
|
+
3.1.3 [ ] hello there new a u 3 (2010-06-15)
|
43
|
+
3.2 [ ] hello there new a u 3.2 (2010-06-15)
|
44
|
+
3.2.1 [ ] hello there new a u 3.2.1 (2010-06-15)
|
45
|
+
3.2.1.1 [ ] hello there new a u 3.2.1.1 (2010-06-15)
|
46
|
+
[37m[1m 4 [ ] (B) start rubyforge project for todorb (2010-06-14) [0m
|
47
|
+
[37m[1m 6 [ ] (B) allow for ENV VARS such as verbose, plain, force (2010-06-15) [0m
|
48
|
+
[33m[1m 7 [ ] (A) list: search terms with - + and = (2010-06-15) [0m
|
49
|
+
[33m[1m 5 [ ] (A) list: if dir given then show full path of TODO2.txt at end (2010-06-14) [0m
|
50
|
+
|
51
|
+
11 of 14 rows displayed from TODO2.txt
|
52
|
+
>>> end
|
53
|
+
|
54
|
+
EOF
|
55
|
+
test_done
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
test_description="Testing out status "
|
3
|
+
. ./test-lib.sh
|
4
|
+
|
5
|
+
|
6
|
+
cat > TODO2.txt <<CATEOF
|
7
|
+
1 [ ] if no TODO file give proper message to add task (2010-06-14)
|
8
|
+
2 [ ] what if no serial_number file? (2010-06-14)
|
9
|
+
3 [ ] Add a close for status close (2010-06-14)
|
10
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
11
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
12
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
13
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
14
|
+
CATEOF
|
15
|
+
|
16
|
+
test_todo_session "Testing of status" <<EOF
|
17
|
+
>>> todorb close 2
|
18
|
+
[32m 2 : [x] what if no serial_number file? (2010-06-14) [0m
|
19
|
+
Changed 1 task/s
|
20
|
+
>>> end
|
21
|
+
>>> todorb
|
22
|
+
1 [ ] if no TODO file give proper message to add task (2010-06-14)
|
23
|
+
3 [ ] Add a close for status close (2010-06-14)
|
24
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
25
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
26
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
27
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
28
|
+
|
29
|
+
6 of 7 rows displayed from TODO2.txt
|
30
|
+
>>> end
|
31
|
+
>>> todorb open 2
|
32
|
+
[32m 2 : [ ] what if no serial_number file? (2010-06-14) [0m
|
33
|
+
Changed 1 task/s
|
34
|
+
>>> end
|
35
|
+
>>> todorb
|
36
|
+
1 [ ] if no TODO file give proper message to add task (2010-06-14)
|
37
|
+
2 [ ] what if no serial_number file? (2010-06-14)
|
38
|
+
3 [ ] Add a close for status close (2010-06-14)
|
39
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
40
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
41
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
42
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
43
|
+
|
44
|
+
7 of 7 rows displayed from TODO2.txt
|
45
|
+
>>> end
|
46
|
+
>>> todorb close 2 4
|
47
|
+
[32m 2 : [x] what if no serial_number file? (2010-06-14) [0m
|
48
|
+
[32m 4 : [x] start rubyforge project for todorb (2010-06-14) [0m
|
49
|
+
Changed 2 task/s
|
50
|
+
>>> end
|
51
|
+
>>> todorb status start 3 7
|
52
|
+
[32m 3 : [@] Add a close for status close (2010-06-14) [0m
|
53
|
+
[32m 7 : [@] list: search terms with - + and = (2010-06-15) [0m
|
54
|
+
Changed 2 task/s
|
55
|
+
>>> end
|
56
|
+
>>> todorb
|
57
|
+
1 [ ] if no TODO file give proper message to add task (2010-06-14)
|
58
|
+
3 [@] Add a close for status close (2010-06-14)
|
59
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
60
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
61
|
+
7 [@] list: search terms with - + and = (2010-06-15)
|
62
|
+
|
63
|
+
5 of 7 rows displayed from TODO2.txt
|
64
|
+
>>> end
|
65
|
+
>>> todorb list --show-all
|
66
|
+
1 [ ] if no TODO file give proper message to add task (2010-06-14)
|
67
|
+
2 [x] what if no serial_number file? (2010-06-14)
|
68
|
+
3 [@] Add a close for status close (2010-06-14)
|
69
|
+
4 [x] start rubyforge project for todorb (2010-06-14)
|
70
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
71
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
72
|
+
7 [@] list: search terms with - + and = (2010-06-15)
|
73
|
+
|
74
|
+
7 of 7 rows displayed from TODO2.txt
|
75
|
+
>>> end
|
76
|
+
|
77
|
+
EOF
|
78
|
+
test_done
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
test_description="Testing out addsub "
|
3
|
+
. ./test-lib.sh
|
4
|
+
|
5
|
+
|
6
|
+
cat > TODO2.txt <<CATEOF
|
7
|
+
1 [ ] if no TODO file give proper message to add task (2010-06-14)
|
8
|
+
2 [ ] what if no serial_number file? (2010-06-14)
|
9
|
+
3 [ ] Add a close for status close (2010-06-14)
|
10
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
11
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
12
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
13
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
14
|
+
CATEOF
|
15
|
+
|
16
|
+
test_todo_session "Testing of addsub" <<EOF
|
17
|
+
>>> todorb addsub 1 "create serial_number file"
|
18
|
+
Adding:
|
19
|
+
1.1 [ ] create serial_number file (2009-02-13)
|
20
|
+
>>> end
|
21
|
+
>>> todorb
|
22
|
+
1 [ ] if no TODO file give proper message to add task (2010-06-14)
|
23
|
+
1.1 [ ] create serial_number file (2009-02-13)
|
24
|
+
2 [ ] what if no serial_number file? (2010-06-14)
|
25
|
+
3 [ ] Add a close for status close (2010-06-14)
|
26
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
27
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
28
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
29
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
30
|
+
|
31
|
+
8 of 8 rows displayed from TODO2.txt
|
32
|
+
>>> end
|
33
|
+
>>> todorb addsub 1 "reset serial file when doing redo"
|
34
|
+
Adding:
|
35
|
+
1.2 [ ] reset serial file when doing redo (2009-02-13)
|
36
|
+
>>> end
|
37
|
+
>>> todorb addsub 1.1 "update serial file"
|
38
|
+
Adding:
|
39
|
+
1.1.1 [ ] update serial file (2009-02-13)
|
40
|
+
>>> end
|
41
|
+
>>> todorb
|
42
|
+
1 [ ] if no TODO file give proper message to add task (2010-06-14)
|
43
|
+
1.1 [ ] create serial_number file (2009-02-13)
|
44
|
+
1.1.1 [ ] update serial file (2009-02-13)
|
45
|
+
1.2 [ ] reset serial file when doing redo (2009-02-13)
|
46
|
+
2 [ ] what if no serial_number file? (2010-06-14)
|
47
|
+
3 [ ] Add a close for status close (2010-06-14)
|
48
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
49
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
50
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
51
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
52
|
+
|
53
|
+
10 of 10 rows displayed from TODO2.txt
|
54
|
+
>>> end
|
55
|
+
>>> todorb close 1
|
56
|
+
[32m 1 : [x] if no TODO file give proper message to add task (2010-06-14) [0m
|
57
|
+
[32m 1.1 : [x] create serial_number file (2009-02-13) [0m
|
58
|
+
[32m 1.1.1 : [x] update serial file (2009-02-13) [0m
|
59
|
+
[32m 1.2 : [x] reset serial file when doing redo (2009-02-13) [0m
|
60
|
+
Changed 4 task/s
|
61
|
+
>>> end
|
62
|
+
>>> todorb list --show-all
|
63
|
+
1 [x] if no TODO file give proper message to add task (2010-06-14)
|
64
|
+
1.1 [x] create serial_number file (2009-02-13)
|
65
|
+
1.1.1 [x] update serial file (2009-02-13)
|
66
|
+
1.2 [x] reset serial file when doing redo (2009-02-13)
|
67
|
+
2 [ ] what if no serial_number file? (2010-06-14)
|
68
|
+
3 [ ] Add a close for status close (2010-06-14)
|
69
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
70
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
71
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
72
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
73
|
+
|
74
|
+
10 of 10 rows displayed from TODO2.txt
|
75
|
+
>>> end
|
76
|
+
|
77
|
+
EOF
|
78
|
+
test_done
|
data/tests/t0009-del.sh
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
test_description="Testing out del "
|
3
|
+
. ./test-lib.sh
|
4
|
+
|
5
|
+
|
6
|
+
cat > TODO2.txt <<CATEOF
|
7
|
+
1 [x] if no TODO file give proper message to add task (2010-06-14)
|
8
|
+
2 [x] what if no serial_number file? (2010-06-14)
|
9
|
+
3 [x] Add a close for status close (2010-06-14)
|
10
|
+
3.1 [ ] hello there new a u 3 (2010-06-15)
|
11
|
+
3.1.1 [ ] hello there new a u 3 (2010-06-15)
|
12
|
+
3.1.2 [ ] hello there new a u 3 (2010-06-15)
|
13
|
+
3.1.3 [ ] hello there new a u 3 (2010-06-15)
|
14
|
+
3.2 [ ] hello there new a u 3.2 (2010-06-15)
|
15
|
+
3.2.1 [ ] hello there new a u 3.2.1 (2010-06-15)
|
16
|
+
3.2.1.1 [ ] hello there new a u 3.2.1.1 (2010-06-15)
|
17
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
18
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
19
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
20
|
+
7 [ ] list: search terms with - + and = (2010-06-15)
|
21
|
+
CATEOF
|
22
|
+
|
23
|
+
test_todo_session "Testing of del" <<EOF
|
24
|
+
>>> todorb del --force 4 5 6
|
25
|
+
4 [ ] start rubyforge project for todorb (2010-06-14)
|
26
|
+
5 [ ] list: if dir given then show full path of TODO2.txt at end (2010-06-14)
|
27
|
+
6 [ ] allow for ENV VARS such as verbose, plain, force (2010-06-15)
|
28
|
+
Deleted 3 task/s
|
29
|
+
>>> end
|
30
|
+
>>> todorb del --force --recursive 3
|
31
|
+
3 [x] Add a close for status close (2010-06-14)
|
32
|
+
3.1 [ ] hello there new a u 3 (2010-06-15)
|
33
|
+
3.1.1 [ ] hello there new a u 3 (2010-06-15)
|
34
|
+
3.1.2 [ ] hello there new a u 3 (2010-06-15)
|
35
|
+
3.1.3 [ ] hello there new a u 3 (2010-06-15)
|
36
|
+
3.2 [ ] hello there new a u 3.2 (2010-06-15)
|
37
|
+
3.2.1 [ ] hello there new a u 3.2.1 (2010-06-15)
|
38
|
+
3.2.1.1 [ ] hello there new a u 3.2.1.1 (2010-06-15)
|
39
|
+
Deleted 8 task/s
|
40
|
+
>>> end
|
41
|
+
|
42
|
+
EOF
|
43
|
+
test_done
|
data/tests/test-lib.sh
CHANGED
@@ -440,8 +440,10 @@ test_init_todo () {
|
|
440
440
|
|
441
441
|
# Install latest todo.sh
|
442
442
|
mkdir bin
|
443
|
+
# TODO: XXX
|
443
444
|
#ln -s "$TEST_DIRECTORY/../todoapp.sh" bin/todoapp.sh
|
444
445
|
ln -s ~/bin/todorb bin/todorb
|
446
|
+
# ln -s ../../../lib/subcommand.rb bin/subcommand.rb
|
445
447
|
|
446
448
|
# Initialize a hack date script
|
447
449
|
TODO_TEST_REAL_DATE=$(which date)
|
@@ -530,17 +532,12 @@ test_todo_session () {
|
|
530
532
|
status=0
|
531
533
|
> expect
|
532
534
|
#while read line
|
535
|
+
# earlier the program would stop expect on a blank line which is unacceptable
|
536
|
+
# i pass an explicit end, since my output does have blank lines
|
533
537
|
while IFS='' read line
|
534
538
|
do
|
535
539
|
case $line in
|
536
|
-
|
537
|
-
test -z "$cmd" || error "bug in the test script: missing blank line separator in test_todo_session"
|
538
|
-
cmd=${line#>>> }
|
539
|
-
;;
|
540
|
-
"=== "*)
|
541
|
-
status=${line#=== }
|
542
|
-
;;
|
543
|
-
"")
|
540
|
+
">>> end")
|
544
541
|
if [ ! -z "$cmd" ]; then
|
545
542
|
if [ $status = 0 ]; then
|
546
543
|
test_expect_success "$1 $subnum" "$cmd > output && test_cmp expect output"
|
@@ -555,8 +552,15 @@ test_todo_session () {
|
|
555
552
|
> expect
|
556
553
|
fi
|
557
554
|
;;
|
555
|
+
">>> "*)
|
556
|
+
test -z "$cmd" || error "bug in the test script: missing blank line separator in test_todo_session"
|
557
|
+
cmd=${line#>>> }
|
558
|
+
;;
|
559
|
+
"=== "*)
|
560
|
+
status=${line#=== }
|
561
|
+
;;
|
558
562
|
*)
|
559
|
-
# please
|
563
|
+
# WARNING please NOTE XXX that a blank line in output terminates what goes into expect !!! See above
|
560
564
|
echo "$line" >> expect
|
561
565
|
;;
|
562
566
|
esac
|
data/todorb.gemspec
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{todorb}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rahul Kumar"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-23}
|
13
13
|
s.default_executable = %q{todorb}
|
14
|
-
s.description = %q{command-line program that manages a todo list text file }
|
14
|
+
s.description = %q{command-line program that manages a todo list text file, incl subtasks }
|
15
15
|
s.email = %q{sentinel1879@gmail.com}
|
16
16
|
s.executables = ["todorb"]
|
17
17
|
s.extra_rdoc_files = [
|
@@ -34,11 +34,20 @@ Gem::Specification.new do |s|
|
|
34
34
|
"tests/README",
|
35
35
|
"tests/aggregate-results.sh",
|
36
36
|
"tests/clean.sh",
|
37
|
+
"tests/data.1",
|
38
|
+
"tests/data.2",
|
37
39
|
"tests/dataset1.txt",
|
38
40
|
"tests/recreate.sh",
|
39
41
|
"tests/rtest2.sh",
|
40
|
-
"tests/t0001-
|
41
|
-
"tests/t0002-
|
42
|
+
"tests/t0001-help.sh",
|
43
|
+
"tests/t0002-subc_help.sh",
|
44
|
+
"tests/t0003-add.sh",
|
45
|
+
"tests/t0004-list.sh",
|
46
|
+
"tests/t0005-pri.sh",
|
47
|
+
"tests/t0006-pri_sort.sh",
|
48
|
+
"tests/t0007-status.sh",
|
49
|
+
"tests/t0008-addsub.sh",
|
50
|
+
"tests/t0009-del.sh",
|
42
51
|
"tests/test-lib.sh",
|
43
52
|
"todorb.gemspec"
|
44
53
|
]
|
@@ -47,16 +56,19 @@ Gem::Specification.new do |s|
|
|
47
56
|
s.require_paths = ["lib"]
|
48
57
|
s.rubyforge_project = %q{todorb}
|
49
58
|
s.rubygems_version = %q{1.3.6}
|
50
|
-
s.summary = %q{command-line todo list manager}
|
59
|
+
s.summary = %q{comprehensive command-line todo list manager with subtasks and more}
|
51
60
|
|
52
61
|
if s.respond_to? :specification_version then
|
53
62
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
54
63
|
s.specification_version = 3
|
55
64
|
|
56
65
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
66
|
+
s.add_development_dependency(%q<subcommand>, [">= 0"])
|
57
67
|
else
|
68
|
+
s.add_dependency(%q<subcommand>, [">= 0"])
|
58
69
|
end
|
59
70
|
else
|
71
|
+
s.add_dependency(%q<subcommand>, [">= 0"])
|
60
72
|
end
|
61
73
|
end
|
62
74
|
|