pomo 0.1.0 → 0.2.0

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/History.md CHANGED
@@ -1,3 +1,10 @@
1
+
2
+ 0.2.0 / 2009-10-28
3
+ ==================
4
+
5
+ * Added several metadata related methods to Pomo::GithubTask
6
+ * Added `pomo init` for localized .pomo
7
+ * Normalized verbose messages
1
8
 
2
9
  0.1.0 / 2009-10-16
3
10
  ==================
data/Readme.md CHANGED
@@ -107,6 +107,11 @@ Remove all tasks:
107
107
  $ pomo remove all
108
108
  $ pomo rm all
109
109
 
110
+ Or if you prefer, create a directory specific task list. Pomo will
111
+ auto-detect _./.pomo_ in this directory, and utilize it's contents.
112
+ $ pomo init
113
+
114
+
110
115
  ## License
111
116
 
112
117
  (The MIT License)
data/bin/pomo CHANGED
@@ -27,10 +27,21 @@ program :int_message, "\nTerminated pomo" \
27
27
  "\n * previously running tasks not marked as complete" \
28
28
  "\n * manually complete a task with `$ pomo complete <task>`"
29
29
 
30
- list = Pomo::List.new '~/.pomo'
30
+ list = Pomo::List.new File.exists?('.pomo') ? '.pomo' : '~/.pomo'
31
31
 
32
32
  default_command :list
33
33
 
34
+ command :init do |c|
35
+ c.syntax = 'pomo init [options]'
36
+ c.description = 'Initialize pomo in the current directory'
37
+ c.action do |args, options|
38
+ Pomo::List.new '.pomo'
39
+ say "Initialized at `./.pomo`"
40
+ say " - Any commands run while in this directory will reference this file for tasks"
41
+ say " - To remove simply execute `rm .pomo`"
42
+ end
43
+ end
44
+
34
45
  command :start do |c|
35
46
  c.syntax = 'pomo start [task] [options]'
36
47
  c.summary = 'Start a task'
@@ -65,9 +76,14 @@ command :import do |c|
65
76
  if repo = Octopi::Repository.find(user, project)
66
77
  say "Importing items from http://github.com/#{user}/#{project}"
67
78
  repo.issues.select { |i| not i.closed_at }.each do |issue|
68
- task = Pomo::GithubTask.new issue.title, :username => user, :project => project, :description => issue.body
79
+ task = Pomo::GithubTask.new issue.title,
80
+ :username => user,
81
+ :project => project,
82
+ :description => issue.body,
83
+ :labels => issue.labels,
84
+ :number => issue.number
69
85
  list << task
70
- say "Added #{task}"
86
+ say " - Added #{task}"
71
87
  end
72
88
  list.save
73
89
  end
@@ -87,7 +103,7 @@ command :add do |c|
87
103
  task = Pomo::Task.new(args.shift, options.__hash__)
88
104
  list << task
89
105
  list.save
90
- say "Task #{task} added"
106
+ say " - Added #{task}"
91
107
  end
92
108
  end
93
109
 
@@ -120,7 +136,7 @@ command :remove do |c|
120
136
  c.action do |args, options|
121
137
  list.find(*args) do |task, i|
122
138
  list.tasks -= [task]
123
- say "Removed #{task}"
139
+ say " - Removed #{task}"
124
140
  end
125
141
  list.save
126
142
  end
@@ -141,7 +157,12 @@ command :view do |c|
141
157
  format = "%15s : %s\n"
142
158
  say format % ['name', task.name]
143
159
  say format % ['length', "#{task.length} minutes"]
144
- say format % ['description', task.description || '...']
160
+ say format % ['description', task.description] if task.description and not task.description.empty?
161
+ if task.github?
162
+ say format % ['labels', task.labels.join(', ')] if task.labels and not task.labels.empty?
163
+ say format % ['number', task.number ]
164
+ say format % ['uri', task.uri ]
165
+ end
145
166
  end
146
167
  say "\n"
147
168
  end
@@ -157,7 +178,7 @@ command :complete do |c|
157
178
  c.action do |args, options|
158
179
  list.find(*args) do |task, i|
159
180
  task.complete = true
160
- say "Completed #{task}"
181
+ say " - Completed #{task}"
161
182
  end
162
183
  list.save
163
184
  end
@@ -1,24 +1,53 @@
1
1
 
2
2
  module Pomo
3
+ class Task
4
+ def github?
5
+ false
6
+ end
7
+ end
8
+
3
9
  class GithubTask < Task
4
10
 
5
11
  ##
6
12
  # Username.
7
13
 
8
- attr_reader :username
14
+ attr_accessor :username
9
15
 
10
16
  ##
11
17
  # Project name.
12
18
 
13
- attr_reader :project
19
+ attr_accessor :project
20
+
21
+ ##
22
+ # Labels array.
23
+
24
+ attr_accessor :labels
25
+
26
+ ##
27
+ # Issue number.
28
+
29
+ attr_accessor :number
14
30
 
15
31
  ##
16
32
  # Initialize with _name_ and _options_.
17
33
 
18
34
  def initialize name = nil, options = {}
19
35
  super
20
- @username = options.delete :username
21
- @project = options.delete :project
36
+ options.each { |k,v| send :"#{k}=", v }
37
+ end
38
+
39
+ ##
40
+ # Check if the task is a github issue.
41
+
42
+ def github?
43
+ true
44
+ end
45
+
46
+ ##
47
+ # Absolute URI to github issue.
48
+
49
+ def uri
50
+ "http://github.com/#{username}/#{project}/issues#issue/#{number}"
22
51
  end
23
52
 
24
53
  end
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Pomo
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{pomo}
5
- s.version = "0.1.0"
5
+ s.version = "0.2.0"
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"]
9
- s.date = %q{2009-10-21}
9
+ s.date = %q{2009-10-28}
10
10
  s.default_executable = %q{pomo}
11
11
  s.description = %q{Pomodoro time management for the command-line}
12
12
  s.email = %q{tj@vision-media.ca}
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-21 00:00:00 -07:00
12
+ date: 2009-10-28 00:00:00 -07:00
13
13
  default_executable: pomo
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency