do_stuff 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +24 -16
  2. data/lib/do_stuff/runner.rb +6 -2
  3. metadata +2 -2
data/README.md CHANGED
@@ -30,38 +30,46 @@ Usage
30
30
  See `t -h`. Examples of use below.
31
31
 
32
32
  ```
33
+ [~]$ t -h
34
+ usage: t list unfinished tasks
35
+ t <task desc> add a new task
36
+ t <task num> erase task
37
+ t -e [task num] edit task file and jump to given task
38
+ t -h, --help show this message
33
39
  [~]$ t That thing I need to do.
34
40
  Added #1: That thing I need to do.
35
- [~]$ t
36
- 1. That thing I need to do.
37
- [~]$ t -e # edit the todo.txt in $EDITOR
38
- [~]$ t Another thing.
39
- Added #3: Another thing.
40
- [~]$ t And another.
41
- Added #4: And another.
41
+ [~]$ t -e # open the todo file with $EDITOR
42
+ Added #2: That thing I added from -e.
43
+ [~]$ t Walk the dog.
44
+ Added #3: Walk the dog.
45
+ [~]$ t Wash my clothes.
46
+ Added #4: Wash my clothes.
42
47
  [~]$ t ALL the things.
43
48
  Added #5: ALL the things.
44
49
  [~]$ t
45
50
  1. That thing I need to do.
46
51
  2. That thing I added from -e.
47
- 3. Another thing.
48
- 4. And another.
52
+ 3. Walk the dog.
53
+ 4. Wash my clothes.
49
54
  5. ALL the things.
50
55
  [~]$ t 2
51
56
  Erased #2: That thing I added from -e.
52
57
  [~]$ t 4
53
- Erased #4: And another.
58
+ Erased #4: Wash my clothes.
54
59
  [~]$ t
55
60
  1. That thing I need to do.
56
- 3. Another thing.
61
+ 3. Walk the dog.
57
62
  5. ALL the things.
58
- [~]$ t Edit my todo list.
59
- Added #2: Edit my todo list.
63
+ [~]$ t Edit my todo list in vim.
64
+ Added #2: Edit my todo list in vim.
60
65
  [~]$ t
61
66
  1. That thing I need to do.
62
- 2. Edit my todo list.
63
- 3. Another thing.
67
+ 2. Edit my todo list in vim.
68
+ 3. Walk the dog.
64
69
  5. ALL the things.
65
- [~]$ t -e2 # start $EDITOR at task 2 in todo.txt (if possible)
70
+ [~]$ t -e2 # edit with $EDITOR, jumping to line with task #2
71
+ Changed #2:
72
+ -Edit my todo list in vim.
73
+ +Finish the demonstration.
66
74
  ```
67
75
 
@@ -3,6 +3,10 @@ require 'optparse'
3
3
 
4
4
  module DoStuff
5
5
  module Runner
6
+ RED = "\033[31;1m"
7
+ GREEN = "\033[32;1m"
8
+ RESET = "\033[m"
9
+
6
10
  def self.execute(*argv)
7
11
  dostuffrc = ENV['HOME'] + '/.do_stuffrc'
8
12
  abort "Error: Couldn't find #{dostuffrc}.\nPlease create it and put " +
@@ -63,8 +67,8 @@ module DoStuff
63
67
  old_keys.each do |task_num|
64
68
  if pre_todolist[task_num] != post_todolist[task_num]
65
69
  puts "Changed ##{task_num}:"
66
- puts "\033[31;1m-#{pre_todolist[task_num]}" # red
67
- puts "\033[32;1m+#{post_todolist[task_num]}" # green
70
+ puts "#{RED}-#{pre_todolist[task_num]}#{RESET}"
71
+ puts "#{GREEN}+#{post_todolist[task_num]}#{RESET}"
68
72
  end
69
73
  end
70
74
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: do_stuff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
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-02-27 00:00:00.000000000 Z
12
+ date: 2012-03-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A minimalistic command-line todo list
15
15
  email: scott@scott-olson.org