pomo 0.0.1 → 0.0.2

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 CHANGED
@@ -3,12 +3,75 @@
3
3
 
4
4
  Command-line application for the [Pomodoro](http://www.pomodorotechnique.com/) time management technique.
5
5
 
6
- ## Features
7
-
8
- * Communicates via Growl
6
+ ## Description
9
7
 
8
+ With Pomo you can add, remove, list, view, and start timing tasks all via the
9
+ command-line with a simple, slick interface. You are reminded of the remaining
10
+ time on a task via Growl. These notifications appear half-way, at the 5 minute point,
11
+ and when the task duration has expired.
12
+
10
13
  ## Examples
11
14
 
15
+ View global or command specific help:
16
+ $ pomo help
17
+ $ pomo help add
18
+ $ pomo help remove
19
+
20
+ Get started by adding a task:
21
+ $ pomo add "Fix IE stying issues"
22
+
23
+ And another:
24
+ $ pomo add "Destroy IE" --description "because IE is terrible"
25
+
26
+ List your tasks:
27
+ $ pomo list
28
+ 0. Fix IE stying issues : 25 minutes
29
+ 1. Destroy IE : 25 minutes
30
+
31
+ Start the first task:
32
+ $ pomo start
33
+ Started Fix IE stying issues, you have 25 minutes :)
34
+ (=........................) 24 minutes remaining
35
+
36
+ Once you have completed the task, list again:
37
+ $ pomo list
38
+ √ 0. Fix IE stying issues : 25 minutes
39
+ 1. Destroy IE : 25 minutes
40
+
41
+ At any time mid-task you may terminate pomo via CTRL + C, at which time
42
+ you may manually complete the task:
43
+ $ pomo complete first
44
+ $ pomo complete last
45
+ $ pomo complete 1
46
+ $ pomo complete 5
47
+
48
+ The next time you run `pomo start` the first incomplete task will start:
49
+ $ pomo start
50
+
51
+ Or choose a specific task:
52
+ $ pomo start first
53
+ $ pomo start last
54
+ $ pomo start 5
55
+
56
+ You may also remove tasks
57
+ $ pomo remove first
58
+ $ pomo remove last
59
+ $ pomo remove 2
60
+ $ pomo remove 1
61
+ $ pomo remove 6
62
+ $ pomo rm first
63
+ $ pomo rm last
64
+
65
+ View task details:
66
+ $ pomo view first
67
+ $ pomo view last
68
+ $ pomo view 5
69
+ $ pomo view 1
70
+
71
+ Remove all tasks:
72
+ $ pomo remove all
73
+ $ pomo rm all
74
+
12
75
  ## License
13
76
 
14
77
  (The MIT License)
data/bin/pomo CHANGED
@@ -15,12 +15,17 @@ command :start do |c|
15
15
  c.syntax = 'pomo start [number] [options]'
16
16
  c.summary = 'Start a task'
17
17
  c.description = 'Start a task, given the task [number] or the first task'
18
+ c.example 'Start the first task', 'pomo start'
19
+ c.example 'Start the first task', 'pomo start 0'
20
+ c.example 'Start the first task', 'pomo start first'
21
+ c.example 'Start the fifth task', 'pomo start 5'
18
22
  c.action do |args, options|
19
- task = list.tasks.at(args.first ? args.first.to_i : 0)
20
- abort 'task already completed' if task.complete?
21
- say "Started #{task}, you have #{task.length} minutes :)"
22
- task.start
23
- list.save
23
+ if task = list.tasks.at(args.first ? args.first.to_i : 0)
24
+ abort 'task already completed' if task.complete?
25
+ say "Started #{task}, you have #{task.length} minutes :)"
26
+ task.start
27
+ list.save
28
+ end
24
29
  end
25
30
  end
26
31
  alias_command :'start first', :start, '0'
@@ -46,6 +51,10 @@ command :remove do |c|
46
51
  c.syntax = 'pomo [remove|rm] <number> [options]'
47
52
  c.summary = 'Remove a task'
48
53
  c.description = 'Remove a task, given the task <number>'
54
+ c.example 'Remove the first task', 'pomo remove first'
55
+ c.example 'Remove the last task', 'pomo remove last'
56
+ c.example 'Remove the fifth task', 'pomo remove 5'
57
+ c.example 'Remove the fifth task', 'pomo rm 5'
49
58
  c.action do |args, options|
50
59
  list.tasks.each_with_index do |task, i|
51
60
  if i == args.first.to_i
@@ -60,10 +69,24 @@ alias_command :rm, :remove
60
69
  alias_command :'remove first', :remove, '0'
61
70
  alias_command :'remove last', :remove, list.tasks.length - 1
62
71
 
72
+ command :'remove all' do |c|
73
+ c.syntax = 'pomo remove all'
74
+ c.description = 'Remove all tasks'
75
+ c.action do
76
+ list.tasks = []
77
+ list.save
78
+ say "Tasks removed"
79
+ end
80
+ end
81
+ alias_command :'rm all', :'remove all'
82
+
63
83
  command :view do |c|
64
84
  c.syntax = 'pomo view [number] [options]'
65
85
  c.summary = 'View a task'
66
86
  c.description = 'View verbose information for the given task [number] or the first task'
87
+ c.example 'View the first task', 'pomo view first'
88
+ c.example 'View the last task', 'pomo view last'
89
+ c.example 'View the fifth task', 'pomo view 5'
67
90
  c.action do |args, options|
68
91
  if task = list.tasks.at(args.first ? args.first.to_i : 0)
69
92
  format = "%15s : %s\n"
@@ -76,9 +99,28 @@ end
76
99
  alias_command :'view first', :view, '0'
77
100
  alias_command :'view last', :view, list.tasks.length - 1
78
101
 
102
+ command :complete do |c|
103
+ c.syntax = 'pomo complete [number] [options]'
104
+ c.summary = 'Mark a task as completed'
105
+ c.description = 'Mark the given task [number] or the first task to complete'
106
+ c.example 'Mark first task as complete', 'pomo complete first'
107
+ c.example 'Mark last task as complete', 'pomo complete last'
108
+ c.example 'Mark fifth task as complete', 'pomo complete 5'
109
+ c.action do |args, options|
110
+ if task = list.tasks.at(args.first ? args.first.to_i : 0)
111
+ task.complete = true
112
+ list.save
113
+ say "Completed #{task}"
114
+ end
115
+ end
116
+ end
117
+ alias_command :'complete first', :complete, '0'
118
+ alias_command :'complete last', :complete, list.tasks.length - 1
119
+
79
120
  command :list do |c|
80
121
  c.syntax = 'pomo list [options]'
81
122
  c.description = 'List all tasks'
123
+ c.example 'List all tasks', 'pomo list'
82
124
  c.action do |args, options|
83
125
  list.tasks.each_with_index do |task, i|
84
126
  say ' %s %2d. %-35s : %d minutes' % [task.complete? ? '√' : ' ', i, task.to_s, task.length]
@@ -10,7 +10,7 @@ module Pomo
10
10
  ##
11
11
  # Task array.
12
12
 
13
- attr_reader :tasks
13
+ attr_accessor :tasks
14
14
 
15
15
  ##
16
16
  # Initialize with _path_.
@@ -24,6 +24,11 @@ module Pomo
24
24
 
25
25
  attr_reader :description
26
26
 
27
+ ##
28
+ # Task completion bool.
29
+
30
+ attr_accessor :complete
31
+
27
32
  ##
28
33
  # Initialize with _name_ and _options_.
29
34
 
@@ -38,7 +43,7 @@ module Pomo
38
43
  # Check if the task has been completed.
39
44
 
40
45
  def complete?
41
- @complete
46
+ complete
42
47
  end
43
48
 
44
49
  ##
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Pomo
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{pomo}
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["TJ Holowaychuk"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk